cleanup inlines
[buildroot.git] / package / libgtk2 / menu-deactivate.patch
blobcfb8849e9f2beb210c86c0a93ec1dff1473239bf
1 --- gtk+-2.10.0/gtk/gtkmenushell.c.orig 2006-07-05 17:17:34.000000000 +0200
2 +++ gtk+-2.10.0/gtk/gtkmenushell.c 2006-07-05 17:19:01.000000000 +0200
3 @@ -42,7 +42,7 @@
4 #include "gtkintl.h"
5 #include "gtkalias.h"
7 -#define MENU_SHELL_TIMEOUT 500
8 +#define MENU_SHELL_TIMEOUT 2000
10 #define PACK_DIRECTION(m) \
11 (GTK_IS_MENU_BAR (m) \
12 @@ -203,6 +203,8 @@
14 G_DEFINE_TYPE (GtkMenuShell, gtk_menu_shell, GTK_TYPE_CONTAINER)
16 +static int last_crossing_time;
18 static void
19 gtk_menu_shell_class_init (GtkMenuShellClass *klass)
21 @@ -517,6 +519,7 @@
22 gtk_grab_add (GTK_WIDGET (menu_shell));
23 menu_shell->have_grab = TRUE;
24 menu_shell->active = TRUE;
25 + last_crossing_time = 0;
29 @@ -669,6 +672,13 @@
30 menu_shell->activate_time = 0;
31 deactivate = FALSE;
34 + if (last_crossing_time != 0
35 + && ((event->time - last_crossing_time) < 500))
36 + {
37 + last_crossing_time = 0;
38 + deactivate = FALSE;
39 + }
41 if (deactivate)
43 @@ -716,6 +726,8 @@
45 menu_item = gtk_get_event_widget ((GdkEvent*) event);
47 + last_crossing_time = event->time;
49 if (!menu_item ||
50 (GTK_IS_MENU_ITEM (menu_item) &&
51 !_gtk_menu_item_is_selectable (menu_item)))