Commit 8821161c authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Take window groups into account. (#309473, Diego Gonzalez)

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.
parent 45c7c2b0
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
......
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
......
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
......
......@@ -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.
......
......@@ -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));
}
}
......
......@@ -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
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment