2005-01-07 Jan Dj\e,Ad\e(Brv <jan.h.d@swipnet.se>
+ * xmenu.c (create_and_show_popup_menu): Pass zero as button to
+ gtk_menu_popup if not for_click, so callbacks for the menu are called.
+
* gtkutil.c (xg_gtk_scroll_destroy, xg_create_scroll_bar)
(xg_tool_bar_callback, xg_tool_bar_help_callback)
(update_frame_tool_bar): Cast to EMACS_INT to avoid compiler
G_CALLBACK (menu_highlight_callback));
xg_crazy_callback_abort = 0;
- for (i = 0; i < 5; i++)
- if (FRAME_X_DISPLAY_INFO (f)->grabbed & (1 << i))
- break;
-
if (! for_click)
{
/* Not invoked by a click. pop up at x/y. */
popup_x_y.x = x;
popup_x_y.y = y;
popup_x_y.f = f;
- }
+ i = 0; /* gtk_menu_popup needs this to be 0 for a non-button popup. */
+ }
+ else
+ {
+ for (i = 0; i < 5; i++)
+ if (FRAME_X_DISPLAY_INFO (f)->grabbed & (1 << i))
+ break;
+ }
+
/* Display the menu. */
gtk_widget_show_all (menu);
gtk_menu_popup (GTK_MENU (menu), 0, 0, pos_func, &popup_x_y, i, 0);