summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--ChangeLog.pre-2-108
-rw-r--r--ChangeLog.pre-2-88
-rw-r--r--docs/reference/gtk/tmpl/gtkmain.sgml2
-rw-r--r--gtk/gtkmenu.c15
-rw-r--r--gtk/gtkwindow.c9
-rw-r--r--gtk/gtkwindow.h1
7 files changed, 46 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index f27ec5403..a42045ecd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-07-05 Matthias Clasen <mclasen@redhat.com>
+
+ * 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.
+
2005-07-05 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): in the
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index f27ec5403..a42045ecd 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,11 @@
+2005-07-05 Matthias Clasen <mclasen@redhat.com>
+
+ * 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.
+
2005-07-05 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): in the
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index f27ec5403..a42045ecd 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,11 @@
+2005-07-05 Matthias Clasen <mclasen@redhat.com>
+
+ * 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.
+
2005-07-05 Kristian Rietveld <kris@gtk.org>
* gtk/gtktreeview.c (gtk_tree_view_bin_expose): in the
diff --git a/docs/reference/gtk/tmpl/gtkmain.sgml b/docs/reference/gtk/tmpl/gtkmain.sgml
index ce4d115cc..c45bf6cca 100644
--- a/docs/reference/gtk/tmpl/gtkmain.sgml
+++ b/docs/reference/gtk/tmpl/gtkmain.sgml
@@ -387,7 +387,7 @@ keyboard events are delivered to this widget.
<!-- ##### FUNCTION gtk_grab_get_current ##### -->
<para>
-Queries the current grab.
+Queries the current grab of the default window group.
</para>
@Returns: The widget which currently has the grab or %NULL if no grab is active.
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 4096511b9..de23fe7f6 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -4387,8 +4387,7 @@ gtk_menu_set_monitor (GtkMenu *menu,
/**
* gtk_menu_get_for_attach_widget:
* @widget: a #GtkWidget
- *
- * Returns a list of the menus which are attached to this widget.
+ * * Returns a list of the menus which are attached to this widget.
* This list is owned by GTK+ and must not be modified.
*
* Return value: the list of menus attached to his widget.
@@ -4410,10 +4409,18 @@ 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 ()))
- gtk_menu_shell_cancel (GTK_MENU_SHELL (widget));
+ if (!GTK_IS_MENU_SHELL (grab))
+ gtk_menu_shell_cancel (GTK_MENU_SHELL (widget));
}
}
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 47f560180..981197334 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6943,6 +6943,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 a9871e59b..6d60912c0 100644
--- a/gtk/gtkwindow.h
+++ b/gtk/gtkwindow.h
@@ -391,6 +391,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);