+Fri Feb 22 19:17:46 2002 Owen Taylor <otaylor@redhat.com>
+
+ Patch from Matthias Clasen (#54488)
+
+ * gtk/gtkwindow.c: Set/unset HAS_FOCUS flags here,
+ and do ::has-focus notifications.
+
+ * gtk/gtkclist.c gtk/gtkentry.c gtk/gtksocket.c
+ gtk/gtktext.c gtk/gtktextview.c gtk/gtkwidget.c:
+ Remove unecessary focus_in/out handles and unecessary
+ flag setting.
+
+ * gtk/gtkwidget.c: Adda missing notification on ::parent.
+
Fri Feb 22 18:36:45 2002 Owen Taylor <otaylor@redhat.com>
Fixes for AIX compilation from Miroslaw Dobrzanski-Neumann,
+Fri Feb 22 19:17:46 2002 Owen Taylor <otaylor@redhat.com>
+
+ Patch from Matthias Clasen (#54488)
+
+ * gtk/gtkwindow.c: Set/unset HAS_FOCUS flags here,
+ and do ::has-focus notifications.
+
+ * gtk/gtkclist.c gtk/gtkentry.c gtk/gtksocket.c
+ gtk/gtktext.c gtk/gtktextview.c gtk/gtkwidget.c:
+ Remove unecessary focus_in/out handles and unecessary
+ flag setting.
+
+ * gtk/gtkwidget.c: Adda missing notification on ::parent.
+
Fri Feb 22 18:36:45 2002 Owen Taylor <otaylor@redhat.com>
Fixes for AIX compilation from Miroslaw Dobrzanski-Neumann,
+Fri Feb 22 19:17:46 2002 Owen Taylor <otaylor@redhat.com>
+
+ Patch from Matthias Clasen (#54488)
+
+ * gtk/gtkwindow.c: Set/unset HAS_FOCUS flags here,
+ and do ::has-focus notifications.
+
+ * gtk/gtkclist.c gtk/gtkentry.c gtk/gtksocket.c
+ gtk/gtktext.c gtk/gtktextview.c gtk/gtkwidget.c:
+ Remove unecessary focus_in/out handles and unecessary
+ flag setting.
+
+ * gtk/gtkwidget.c: Adda missing notification on ::parent.
+
Fri Feb 22 18:36:45 2002 Owen Taylor <otaylor@redhat.com>
Fixes for AIX compilation from Miroslaw Dobrzanski-Neumann,
+Fri Feb 22 19:17:46 2002 Owen Taylor <otaylor@redhat.com>
+
+ Patch from Matthias Clasen (#54488)
+
+ * gtk/gtkwindow.c: Set/unset HAS_FOCUS flags here,
+ and do ::has-focus notifications.
+
+ * gtk/gtkclist.c gtk/gtkentry.c gtk/gtksocket.c
+ gtk/gtktext.c gtk/gtktextview.c gtk/gtkwidget.c:
+ Remove unecessary focus_in/out handles and unecessary
+ flag setting.
+
+ * gtk/gtkwidget.c: Adda missing notification on ::parent.
+
Fri Feb 22 18:36:45 2002 Owen Taylor <otaylor@redhat.com>
Fixes for AIX compilation from Miroslaw Dobrzanski-Neumann,
+Fri Feb 22 19:17:46 2002 Owen Taylor <otaylor@redhat.com>
+
+ Patch from Matthias Clasen (#54488)
+
+ * gtk/gtkwindow.c: Set/unset HAS_FOCUS flags here,
+ and do ::has-focus notifications.
+
+ * gtk/gtkclist.c gtk/gtkentry.c gtk/gtksocket.c
+ gtk/gtktext.c gtk/gtktextview.c gtk/gtkwidget.c:
+ Remove unecessary focus_in/out handles and unecessary
+ flag setting.
+
+ * gtk/gtkwidget.c: Adda missing notification on ::parent.
+
Fri Feb 22 18:36:45 2002 Owen Taylor <otaylor@redhat.com>
Fixes for AIX compilation from Miroslaw Dobrzanski-Neumann,
+Fri Feb 22 19:17:46 2002 Owen Taylor <otaylor@redhat.com>
+
+ Patch from Matthias Clasen (#54488)
+
+ * gtk/gtkwindow.c: Set/unset HAS_FOCUS flags here,
+ and do ::has-focus notifications.
+
+ * gtk/gtkclist.c gtk/gtkentry.c gtk/gtksocket.c
+ gtk/gtktext.c gtk/gtktextview.c gtk/gtkwidget.c:
+ Remove unecessary focus_in/out handles and unecessary
+ flag setting.
+
+ * gtk/gtkwidget.c: Adda missing notification on ::parent.
+
Fri Feb 22 18:36:45 2002 Owen Taylor <otaylor@redhat.com>
Fixes for AIX compilation from Miroslaw Dobrzanski-Neumann,
+Fri Feb 22 19:17:46 2002 Owen Taylor <otaylor@redhat.com>
+
+ Patch from Matthias Clasen (#54488)
+
+ * gtk/gtkwindow.c: Set/unset HAS_FOCUS flags here,
+ and do ::has-focus notifications.
+
+ * gtk/gtkclist.c gtk/gtkentry.c gtk/gtksocket.c
+ gtk/gtktext.c gtk/gtktextview.c gtk/gtkwidget.c:
+ Remove unecessary focus_in/out handles and unecessary
+ flag setting.
+
+ * gtk/gtkwidget.c: Adda missing notification on ::parent.
+
Fri Feb 22 18:36:45 2002 Owen Taylor <otaylor@redhat.com>
Fixes for AIX compilation from Miroslaw Dobrzanski-Neumann,
gtk_clist_focus_in (GtkWidget *widget,
GdkEventFocus *event)
{
- GtkCList *clist;
-
- g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE);
- g_return_val_if_fail (event != NULL, FALSE);
-
- GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
-
- clist = GTK_CLIST (widget);
+ GtkCList *clist = GTK_CLIST (widget);
if (clist->selection_mode == GTK_SELECTION_BROWSE &&
clist->selection == NULL && clist->focus_row > -1)
gtk_clist_focus_out (GtkWidget *widget,
GdkEventFocus *event)
{
- GtkCList *clist;
-
- g_return_val_if_fail (GTK_IS_CLIST (widget), FALSE);
- g_return_val_if_fail (event != NULL, FALSE);
-
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
+ GtkCList *clist = GTK_CLIST (widget);
gtk_clist_draw_focus (widget);
- clist = GTK_CLIST (widget);
-
GTK_CLIST_GET_CLASS (widget)->resync_selection (clist, (GdkEvent *) event);
return FALSE;
{
GtkEntry *entry = GTK_ENTRY (widget);
- GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_queue_draw (widget);
entry->need_im_reset = TRUE;
{
GtkEntry *entry = GTK_ENTRY (widget);
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_queue_draw (widget);
entry->need_im_reset = TRUE;
{
GtkSocket *socket = GTK_SOCKET (widget);
- if (!GTK_WIDGET_HAS_FOCUS (widget))
- {
- GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
-
- if (socket->plug_window)
- {
- send_xembed_message (socket, XEMBED_FOCUS_IN, XEMBED_FOCUS_CURRENT, 0, 0,
- gtk_get_current_event_time ());
- }
- }
+ if (socket->plug_window)
+ send_xembed_message (socket, XEMBED_FOCUS_IN, XEMBED_FOCUS_CURRENT, 0, 0,
+ gtk_get_current_event_time ());
return TRUE;
}
{
GtkSocket *socket = GTK_SOCKET (widget);
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
-
#if 0
GtkWidget *toplevel;
toplevel = gtk_widget_get_toplevel (widget);
GdkEventMotion *event);
static gint gtk_text_key_press (GtkWidget *widget,
GdkEventKey *event);
-static gint gtk_text_focus_in (GtkWidget *widget,
- GdkEventFocus *event);
-static gint gtk_text_focus_out (GtkWidget *widget,
- GdkEventFocus *event);
static void move_gap (GtkText* text, guint index);
static void make_forward_space (GtkText* text, guint len);
widget_class->button_release_event = gtk_text_button_release;
widget_class->motion_notify_event = gtk_text_motion_notify;
widget_class->key_press_event = gtk_text_key_press;
- widget_class->focus_in_event = gtk_text_focus_in;
- widget_class->focus_out_event = gtk_text_focus_out;
old_editable_class->set_editable = gtk_text_real_set_editable;
return return_val;
}
-static gint
-gtk_text_focus_in (GtkWidget *widget,
- GdkEventFocus *event)
-{
- g_return_val_if_fail (GTK_IS_TEXT (widget), FALSE);
- g_return_val_if_fail (event != NULL, FALSE);
-
- TDEBUG (("in gtk_text_focus_in\n"));
-
- return (* GTK_WIDGET_CLASS (parent_class)->focus_in_event) (widget, event);
-}
-
-static gint
-gtk_text_focus_out (GtkWidget *widget,
- GdkEventFocus *event)
-{
- g_return_val_if_fail (GTK_IS_TEXT (widget), FALSE);
- g_return_val_if_fail (event != NULL, FALSE);
-
- TDEBUG (("in gtk_text_focus_out\n"));
-
- return (* GTK_WIDGET_CLASS (parent_class)->focus_out_event) (widget, event);
-}
-
static void
gtk_text_adjustment (GtkAdjustment *adjustment,
GtkText *text)
{
GtkTextView *text_view = GTK_TEXT_VIEW (widget);
- GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_queue_draw (widget);
DV(g_print (G_STRLOC": focus_in_event\n"));
{
GtkTextView *text_view = GTK_TEXT_VIEW (widget);
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_queue_draw (widget);
DV(g_print (G_STRLOC": focus_out_event\n"));
gtk_widget_real_focus_in_event (GtkWidget *widget,
GdkEventFocus *event)
{
- GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_queue_draw (widget);
return FALSE;
gtk_widget_real_focus_out_event (GtkWidget *widget,
GdkEventFocus *event)
{
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
gtk_widget_queue_draw (widget);
return FALSE;
gtk_widget_reparent_container_child (widget,
gtk_widget_get_parent_window (widget));
}
+
+ g_object_notify (G_OBJECT (widget), "parent");
}
}
return FALSE;
}
+static void
+do_focus_change (GtkWidget *widget,
+ gboolean in)
+{
+ GdkEventFocus fevent;
+
+ g_object_ref (widget);
+
+ if (in)
+ GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_FOCUS);
+ else
+ GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_FOCUS);
+
+ fevent.type = GDK_FOCUS_CHANGE;
+ fevent.window = widget->window;
+ fevent.in = in;
+
+ gtk_widget_event (widget, (GdkEvent*) &fevent);
+
+ g_object_notify (G_OBJECT (widget), "has_focus");
+
+ g_object_unref (widget);
+}
+
static gint
gtk_window_focus_in_event (GtkWidget *widget,
GdkEventFocus *event)
{
GtkWindow *window = GTK_WINDOW (widget);
- GdkEventFocus fevent;
/* It appears spurious focus in events can occur when
* the window is hidden. So we'll just check to see if
if (window->focus_widget &&
window->focus_widget != widget &&
!GTK_WIDGET_HAS_FOCUS (window->focus_widget))
- {
- fevent.type = GDK_FOCUS_CHANGE;
- fevent.window = window->focus_widget->window;
- fevent.in = TRUE;
-
- gtk_widget_event (window->focus_widget, (GdkEvent*) &fevent);
- }
+ do_focus_change (window->focus_widget, TRUE);
}
return FALSE;
GdkEventFocus *event)
{
GtkWindow *window = GTK_WINDOW (widget);
- GdkEventFocus fevent;
window->has_focus = FALSE;
if (window->focus_widget &&
window->focus_widget != widget &&
GTK_WIDGET_HAS_FOCUS (window->focus_widget))
- {
- fevent.type = GDK_FOCUS_CHANGE;
- fevent.window = window->focus_widget->window;
- fevent.in = FALSE;
-
- gtk_widget_event (window->focus_widget, (GdkEvent*) &fevent);
- }
+ do_focus_change (window->focus_widget, FALSE);
return FALSE;
}
gtk_window_real_set_focus (GtkWindow *window,
GtkWidget *focus)
{
- GdkEventFocus event;
gboolean def_flags = 0;
if (window->default_widget)
}
if (window->has_focus)
- {
- event.type = GDK_FOCUS_CHANGE;
- event.window = window->focus_widget->window;
- event.in = FALSE;
-
- gtk_widget_event (window->focus_widget, (GdkEvent*) &event);
- }
+ do_focus_change (window->focus_widget, FALSE);
}
window->focus_widget = focus;
}
if (window->has_focus)
- {
- event.type = GDK_FOCUS_CHANGE;
- event.window = window->focus_widget->window;
- event.in = TRUE;
-
- gtk_widget_event (window->focus_widget, (GdkEvent*) &event);
- }
+ do_focus_change (window->focus_widget, TRUE);
}
if (window->default_widget &&