From 008608e6cf8df57523894d16f7b6e98d926e3a84 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 15 Aug 2005 04:48:03 +0000 Subject: [PATCH] Backported fixes from 2.8: 2005-08-15 Matthias Clasen Backported fixes from 2.8: * gtk/gtkmenu.c (gtk_menu_grab_notify): Take window groups into account. (#309473, Diego Gonzalez) * gtk/gtkwindow.[hc]: Add a non-exported function to get the grab widget of a window group. --- ChangeLog | 8 +++++++- ChangeLog.pre-2-10 | 8 +++++++- ChangeLog.pre-2-8 | 8 +++++++- gtk/gtkmenu.c | 8 ++++++++ gtk/gtkwindow.c | 9 +++++++++ gtk/gtkwindow.h | 1 + 6 files changed, 39 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index aeeab5fd8f..22f03e7eff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,13 @@ 2005-08-15 Matthias Clasen - Backported fix from 2.8: + Backported fixes from 2.8: + * gtk/gtkmenu.c (gtk_menu_grab_notify): Take window + groups into account. (#309473, Diego Gonzalez) + + * gtk/gtkwindow.[hc]: Add a non-exported function to + get the grab widget of a window group. + * gtk/gtkicontheme.c: When changing the icon theme, defer the resetting of rc styles to an idle, so that it does not happen e.g during expose handling (which is problematic, diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index aeeab5fd8f..22f03e7eff 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,7 +1,13 @@ 2005-08-15 Matthias Clasen - Backported fix from 2.8: + Backported fixes from 2.8: + * gtk/gtkmenu.c (gtk_menu_grab_notify): Take window + groups into account. (#309473, Diego Gonzalez) + + * gtk/gtkwindow.[hc]: Add a non-exported function to + get the grab widget of a window group. + * gtk/gtkicontheme.c: When changing the icon theme, defer the resetting of rc styles to an idle, so that it does not happen e.g during expose handling (which is problematic, diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index aeeab5fd8f..22f03e7eff 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,7 +1,13 @@ 2005-08-15 Matthias Clasen - Backported fix from 2.8: + Backported fixes from 2.8: + * gtk/gtkmenu.c (gtk_menu_grab_notify): Take window + groups into account. (#309473, Diego Gonzalez) + + * gtk/gtkwindow.[hc]: Add a non-exported function to + get the grab widget of a window group. + * gtk/gtkicontheme.c: When changing the icon theme, defer the resetting of rc styles to an idle, so that it does not happen e.g during expose handling (which is problematic, diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index e87bd262c4..c598c8dcc0 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -4385,6 +4385,14 @@ static void gtk_menu_grab_notify (GtkWidget *widget, gboolean was_grabbed) { + GtkWidget *toplevel; + GtkWindowGroup *group; + GtkWidget *grab; + + toplevel = gtk_widget_get_toplevel (widget); + group = _gtk_window_get_group (GTK_WINDOW (toplevel)); + grab = _gtk_window_group_get_current_grab (group); + if (!was_grabbed) { if (!GTK_IS_MENU (gtk_grab_get_current ())) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 6e5217d990..3c0c2a3f67 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -6844,6 +6844,15 @@ _gtk_window_get_group (GtkWindow *window) } } +/* Return the current grab widget of the given group + */ +GtkWidget * +_gtk_window_group_get_current_grab (GtkWindowGroup *window_group) +{ + if (window_group->grabs) + return GTK_WIDGET (window_group->grabs->data); + return NULL; +} /* Derived from XParseGeometry() in XFree86 diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h index 177290f216..8640653df8 100644 --- a/gtk/gtkwindow.h +++ b/gtk/gtkwindow.h @@ -386,6 +386,7 @@ void _gtk_window_constrain_size (GtkWindow *window, gint *new_width, gint *new_height); GtkWindowGroup *_gtk_window_get_group (GtkWindow *window); +GtkWidget *_gtk_window_group_get_current_grab (GtkWindowGroup *window_group); void _gtk_window_set_has_toplevel_focus (GtkWindow *window, gboolean has_toplevel_focus);