From 9b85e63d346b2e4de1295228356d4e2ea49a3ff1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Fri, 7 Jan 2005 20:50:46 +0000 Subject: [PATCH] * 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. --- src/ChangeLog | 3 +++ src/xmenu.c | 14 +++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9e3c5e56559..8a267b46d14 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2005-01-07 Jan Dj,Ad(Brv + * 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 diff --git a/src/xmenu.c b/src/xmenu.c index f9c2dc4bd1b..57f184e121f 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -2454,10 +2454,6 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click) 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. */ @@ -2470,8 +2466,16 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click) 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); -- 2.39.5