Commit a6491199 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor
Browse files

Remove usage of menu_shell->ignore leave which was to deal with stray

Wed Aug 13 17:01:49 2003  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkmenushell.[ch] (gtk_menu_shell_enter_notify):
        Remove usage of menu_shell->ignore leave which was
        to deal with stray events we no longer get because
        we do grabbing differently. Comment it as unused in
        the header. (#115837, Keith Bissett)
parent 91d37680
Wed Aug 13 17:01:49 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.[ch] (gtk_menu_shell_enter_notify):
Remove usage of menu_shell->ignore leave which was
to deal with stray events we no longer get because
we do grabbing differently. Comment it as unused in
the header. (#115837, Keith Bissett)
Wed Aug 13 16:32:43 2003 Owen Taylor <otaylor@redhat.com> Wed Aug 13 16:32:43 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_position, gtk_menu_window_size_request): * gtk/gtkmenu.c (gtk_menu_position, gtk_menu_window_size_request):
......
Wed Aug 13 17:01:49 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.[ch] (gtk_menu_shell_enter_notify):
Remove usage of menu_shell->ignore leave which was
to deal with stray events we no longer get because
we do grabbing differently. Comment it as unused in
the header. (#115837, Keith Bissett)
Wed Aug 13 16:32:43 2003 Owen Taylor <otaylor@redhat.com> Wed Aug 13 16:32:43 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_position, gtk_menu_window_size_request): * gtk/gtkmenu.c (gtk_menu_position, gtk_menu_window_size_request):
......
Wed Aug 13 17:01:49 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.[ch] (gtk_menu_shell_enter_notify):
Remove usage of menu_shell->ignore leave which was
to deal with stray events we no longer get because
we do grabbing differently. Comment it as unused in
the header. (#115837, Keith Bissett)
Wed Aug 13 16:32:43 2003 Owen Taylor <otaylor@redhat.com> Wed Aug 13 16:32:43 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_position, gtk_menu_window_size_request): * gtk/gtkmenu.c (gtk_menu_position, gtk_menu_window_size_request):
......
Wed Aug 13 17:01:49 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.[ch] (gtk_menu_shell_enter_notify):
Remove usage of menu_shell->ignore leave which was
to deal with stray events we no longer get because
we do grabbing differently. Comment it as unused in
the header. (#115837, Keith Bissett)
Wed Aug 13 16:32:43 2003 Owen Taylor <otaylor@redhat.com> Wed Aug 13 16:32:43 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_position, gtk_menu_window_size_request): * gtk/gtkmenu.c (gtk_menu_position, gtk_menu_window_size_request):
......
Wed Aug 13 17:01:49 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenushell.[ch] (gtk_menu_shell_enter_notify):
Remove usage of menu_shell->ignore leave which was
to deal with stray events we no longer get because
we do grabbing differently. Comment it as unused in
the header. (#115837, Keith Bissett)
Wed Aug 13 16:32:43 2003 Owen Taylor <otaylor@redhat.com> Wed Aug 13 16:32:43 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.c (gtk_menu_position, gtk_menu_window_size_request): * gtk/gtkmenu.c (gtk_menu_position, gtk_menu_window_size_request):
......
...@@ -323,7 +323,6 @@ gtk_menu_shell_init (GtkMenuShell *menu_shell) ...@@ -323,7 +323,6 @@ gtk_menu_shell_init (GtkMenuShell *menu_shell)
menu_shell->active = FALSE; menu_shell->active = FALSE;
menu_shell->have_grab = FALSE; menu_shell->have_grab = FALSE;
menu_shell->have_xgrab = FALSE; menu_shell->have_xgrab = FALSE;
menu_shell->ignore_leave = FALSE;
menu_shell->button = 0; menu_shell->button = 0;
menu_shell->menu_flag = 0; menu_shell->menu_flag = 0;
menu_shell->activate_time = 0; menu_shell->activate_time = 0;
...@@ -537,8 +536,13 @@ gtk_menu_shell_button_release (GtkWidget *widget, ...@@ -537,8 +536,13 @@ gtk_menu_shell_button_release (GtkWidget *widget,
gtk_widget_event (menu_shell->parent_menu_shell, (GdkEvent*) event); gtk_widget_event (menu_shell->parent_menu_shell, (GdkEvent*) event);
return TRUE; return TRUE;
} }
/* If we ended up on an item with a submenu, leave the menu up.
*/
if (menu_item && (menu_shell->active_menu_item == menu_item))
deactivate = FALSE;
} }
else else /* a very fast press-release */
{ {
/* We only ever want to prevent deactivation on the first /* We only ever want to prevent deactivation on the first
* press/release. Setting the time to zero is a bit of a * press/release. Setting the time to zero is a bit of a
...@@ -551,18 +555,6 @@ gtk_menu_shell_button_release (GtkWidget *widget, ...@@ -551,18 +555,6 @@ gtk_menu_shell_button_release (GtkWidget *widget,
deactivate = FALSE; deactivate = FALSE;
} }
/* If the button click was very fast, or we ended up on a submenu,
* leave the menu up
*/
if (!deactivate ||
(menu_item && (menu_shell->active_menu_item == menu_item)))
{
deactivate = FALSE;
menu_shell->ignore_leave = TRUE;
}
else
deactivate = TRUE;
if (deactivate) if (deactivate)
{ {
gtk_menu_shell_deactivate (menu_shell); gtk_menu_shell_deactivate (menu_shell);
...@@ -663,12 +655,6 @@ gtk_menu_shell_leave_notify (GtkWidget *widget, ...@@ -663,12 +655,6 @@ gtk_menu_shell_leave_notify (GtkWidget *widget,
menu_item = GTK_MENU_ITEM (event_widget); menu_item = GTK_MENU_ITEM (event_widget);
if (menu_shell->ignore_leave)
{
menu_shell->ignore_leave = FALSE;
return TRUE;
}
if (!_gtk_menu_item_is_selectable (event_widget)) if (!_gtk_menu_item_is_selectable (event_widget))
return TRUE; return TRUE;
......
...@@ -62,7 +62,7 @@ struct _GtkMenuShell ...@@ -62,7 +62,7 @@ struct _GtkMenuShell
guint active : 1; guint active : 1;
guint have_grab : 1; guint have_grab : 1;
guint have_xgrab : 1; guint have_xgrab : 1;
guint ignore_leave : 1; guint ignore_leave : 1; /* unused */
guint menu_flag : 1; guint menu_flag : 1;
guint ignore_enter : 1; guint ignore_enter : 1;
}; };
......
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