call gdk_flush() after showing the menu so we can definitely grab on it.

2007-11-06  Michael Natterer  <mitch@imendio.com>

	* gtk/gtkmenu.c (gtk_menu_popup): call gdk_flush() after showing
	the menu so we can definitely grab on it. Grab failure found by
	Xan Lopez.


svn path=/trunk/; revision=18969
This commit is contained in:
Michael Natterer 2007-11-06 14:23:56 +00:00 committed by Michael Natterer
parent f93e2db2a9
commit 9b3edbc319
2 changed files with 13 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2007-11-06 Michael Natterer <mitch@imendio.com>
* gtk/gtkmenu.c (gtk_menu_popup): call gdk_flush() after showing
the menu so we can definitely grab on it. Grab failure found by
Xan Lopez.
2007-11-06 Michael Natterer <mitch@imendio.com> 2007-11-06 Michael Natterer <mitch@imendio.com>
* gtk/gtkwidget.c (gtk_widget_keynav_failed): fixed docs. * gtk/gtkwidget.c (gtk_widget_keynav_failed): fixed docs.

View File

@ -1449,6 +1449,13 @@ gtk_menu_popup (GtkMenu *menu,
*/ */
gtk_widget_show (menu->toplevel); gtk_widget_show (menu->toplevel);
/* flush the X event queue for the popup to become realized and
* mapped, since grabbing requires a mapped window. (this only works
* for popups, regular windows need gtk_widget_show_now() to sync
* with window manager interaction).
*/
gdk_flush ();
if (xgrab_shell == widget) if (xgrab_shell == widget)
popup_grab_on_window (widget->window, activate_time, grab_keyboard); /* Should always succeed */ popup_grab_on_window (widget->window, activate_time, grab_keyboard); /* Should always succeed */
gtk_grab_add (GTK_WIDGET (menu)); gtk_grab_add (GTK_WIDGET (menu));