Cancel menus when they are grab-shadowed by something thats not a submenu.

2005-06-27  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkmenu.c (gtk_menu_grab_notify): Cancel menus when
        they are grab-shadowed by something thats not a
        submenu.  (#145416, Euan MacGregor)
This commit is contained in:
Matthias Clasen 2005-06-27 17:36:34 +00:00 committed by Matthias Clasen
parent 3b1269f500
commit ddd27f21a6
4 changed files with 32 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2005-06-27 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkmenu.c (gtk_menu_grab_notify): Cancel menus when
they are grab-shadowed by something thats not a
submenu. (#145416, Euan MacGregor)
2005-06-27 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]ruler.c (gtk_[hv]ruler_draw_ticks):

View File

@ -1,3 +1,9 @@
2005-06-27 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkmenu.c (gtk_menu_grab_notify): Cancel menus when
they are grab-shadowed by something thats not a
submenu. (#145416, Euan MacGregor)
2005-06-27 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]ruler.c (gtk_[hv]ruler_draw_ticks):

View File

@ -1,3 +1,9 @@
2005-06-27 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkmenu.c (gtk_menu_grab_notify): Cancel menus when
they are grab-shadowed by something thats not a
submenu. (#145416, Euan MacGregor)
2005-06-27 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]ruler.c (gtk_[hv]ruler_draw_ticks):

View File

@ -175,6 +175,8 @@ static gboolean gtk_menu_leave_notify (GtkWidget *widget,
GdkEventCrossing *event);
static void gtk_menu_scroll_to (GtkMenu *menu,
gint offset);
static void gtk_menu_grab_notify (GtkWidget *widget,
gboolean was_grabbed);
static void gtk_menu_stop_scrolling (GtkMenu *menu);
static void gtk_menu_remove_scroll_timeout (GtkMenu *menu);
@ -501,6 +503,7 @@ gtk_menu_class_init (GtkMenuClass *class)
widget_class->style_set = gtk_menu_style_set;
widget_class->focus = gtk_menu_focus;
widget_class->can_activate_accel = gtk_menu_real_can_activate_accel;
widget_class->grab_notify = gtk_menu_grab_notify;
container_class->remove = gtk_menu_remove;
container_class->get_child_property = gtk_menu_get_child_property;
@ -4403,5 +4406,16 @@ gtk_menu_get_for_attach_widget (GtkWidget *widget)
return list;
}
static void
gtk_menu_grab_notify (GtkWidget *widget,
gboolean was_grabbed)
{
if (!was_grabbed)
{
if (!GTK_IS_MENU (gtk_grab_get_current ()))
gtk_menu_shell_cancel (GTK_MENU_SHELL (widget));
}
}
#define __GTK_MENU_C__
#include "gtkaliasdef.c"