diff --git a/ChangeLog b/ChangeLog index 30396f5630..b6dda62866 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Mon Feb 26 21:36:11 2001 Owen Taylor + + * gtk/gtkwindow.[ch] (gtk_window_focus_in/out_event): We can't + maintain a flag in gtk_window_focus_in/out, because + GtkPlug and cut-and-pastes of GtkPlug override these + methods and don't chain up. So back out recent change + adding such a flag, and instead recycle the hack + GtkPlug uses of making GTK_WIDGET_HAS_FOCUS on the + top level represent this information + Fri Feb 23 15:06:48 2001 Owen Taylor * gtk/gtktree.c (gtk_tree_class_init): Do the setting diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 30396f5630..b6dda62866 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,13 @@ +Mon Feb 26 21:36:11 2001 Owen Taylor + + * gtk/gtkwindow.[ch] (gtk_window_focus_in/out_event): We can't + maintain a flag in gtk_window_focus_in/out, because + GtkPlug and cut-and-pastes of GtkPlug override these + methods and don't chain up. So back out recent change + adding such a flag, and instead recycle the hack + GtkPlug uses of making GTK_WIDGET_HAS_FOCUS on the + top level represent this information + Fri Feb 23 15:06:48 2001 Owen Taylor * gtk/gtktree.c (gtk_tree_class_init): Do the setting diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 30396f5630..b6dda62866 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +Mon Feb 26 21:36:11 2001 Owen Taylor + + * gtk/gtkwindow.[ch] (gtk_window_focus_in/out_event): We can't + maintain a flag in gtk_window_focus_in/out, because + GtkPlug and cut-and-pastes of GtkPlug override these + methods and don't chain up. So back out recent change + adding such a flag, and instead recycle the hack + GtkPlug uses of making GTK_WIDGET_HAS_FOCUS on the + top level represent this information + Fri Feb 23 15:06:48 2001 Owen Taylor * gtk/gtktree.c (gtk_tree_class_init): Do the setting diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 30396f5630..b6dda62866 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,13 @@ +Mon Feb 26 21:36:11 2001 Owen Taylor + + * gtk/gtkwindow.[ch] (gtk_window_focus_in/out_event): We can't + maintain a flag in gtk_window_focus_in/out, because + GtkPlug and cut-and-pastes of GtkPlug override these + methods and don't chain up. So back out recent change + adding such a flag, and instead recycle the hack + GtkPlug uses of making GTK_WIDGET_HAS_FOCUS on the + top level represent this information + Fri Feb 23 15:06:48 2001 Owen Taylor * gtk/gtktree.c (gtk_tree_class_init): Do the setting diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 30396f5630..b6dda62866 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,13 @@ +Mon Feb 26 21:36:11 2001 Owen Taylor + + * gtk/gtkwindow.[ch] (gtk_window_focus_in/out_event): We can't + maintain a flag in gtk_window_focus_in/out, because + GtkPlug and cut-and-pastes of GtkPlug override these + methods and don't chain up. So back out recent change + adding such a flag, and instead recycle the hack + GtkPlug uses of making GTK_WIDGET_HAS_FOCUS on the + top level represent this information + Fri Feb 23 15:06:48 2001 Owen Taylor * gtk/gtktree.c (gtk_tree_class_init): Do the setting diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 30396f5630..b6dda62866 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,13 @@ +Mon Feb 26 21:36:11 2001 Owen Taylor + + * gtk/gtkwindow.[ch] (gtk_window_focus_in/out_event): We can't + maintain a flag in gtk_window_focus_in/out, because + GtkPlug and cut-and-pastes of GtkPlug override these + methods and don't chain up. So back out recent change + adding such a flag, and instead recycle the hack + GtkPlug uses of making GTK_WIDGET_HAS_FOCUS on the + top level represent this information + Fri Feb 23 15:06:48 2001 Owen Taylor * gtk/gtktree.c (gtk_tree_class_init): Do the setting diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 30396f5630..b6dda62866 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +Mon Feb 26 21:36:11 2001 Owen Taylor + + * gtk/gtkwindow.[ch] (gtk_window_focus_in/out_event): We can't + maintain a flag in gtk_window_focus_in/out, because + GtkPlug and cut-and-pastes of GtkPlug override these + methods and don't chain up. So back out recent change + adding such a flag, and instead recycle the hack + GtkPlug uses of making GTK_WIDGET_HAS_FOCUS on the + top level represent this information + Fri Feb 23 15:06:48 2001 Owen Taylor * gtk/gtktree.c (gtk_tree_class_init): Do the setting diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c index 4ee45b8739..c2412e23dc 100644 --- a/gtk/gtkplug.c +++ b/gtk/gtkplug.c @@ -366,6 +366,7 @@ gtk_plug_focus_in_event (GtkWidget *widget, if (GTK_WIDGET_VISIBLE (widget)) { GTK_OBJECT_SET_FLAGS (widget, GTK_HAS_FOCUS); + window = GTK_WINDOW (widget); if (window->focus_widget && !GTK_WIDGET_HAS_FOCUS (window->focus_widget)) { diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 9a600deb69..d6e29ea14d 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -1325,8 +1325,7 @@ gtk_window_focus_in_event (GtkWidget *widget, */ if (GTK_WIDGET_VISIBLE (widget)) { - window->window_has_focus = TRUE; - + GTK_OBJECT_SET_FLAGS (widget, GTK_HAS_FOCUS); window = GTK_WINDOW (widget); if (window->focus_widget && window->focus_widget != widget && @@ -1356,8 +1355,8 @@ gtk_window_focus_out_event (GtkWidget *widget, window = GTK_WINDOW (widget); - window->window_has_focus = FALSE; - + GTK_OBJECT_UNSET_FLAGS (widget, GTK_HAS_FOCUS); + if (window->focus_widget && window->focus_widget != widget && GTK_WIDGET_HAS_FOCUS (window->focus_widget)) @@ -1473,7 +1472,7 @@ gtk_window_real_set_focus (GtkWindow *window, GTK_WIDGET_SET_FLAGS (window->default_widget, GTK_HAS_DEFAULT); } - if (window->window_has_focus) + if (GTK_WIDGET_HAS_FOCUS (window)) { event.type = GDK_FOCUS_CHANGE; event.window = window->focus_widget->window; @@ -1497,7 +1496,7 @@ gtk_window_real_set_focus (GtkWindow *window, GTK_WIDGET_UNSET_FLAGS (window->default_widget, GTK_HAS_DEFAULT); } - if (window->window_has_focus) + if (GTK_WIDGET_HAS_FOCUS (window)) { event.type = GDK_FOCUS_CHANGE; event.window = window->focus_widget->window; diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h index dfdadcf162..53d22948ab 100644 --- a/gtk/gtkwindow.h +++ b/gtk/gtkwindow.h @@ -77,7 +77,6 @@ struct _GtkWindow */ guint use_uposition : 1; guint modal : 1; - guint window_has_focus : 1; }; struct _GtkWindowClass