aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-03-10 11:48:12 +0800
committerPo Lu2022-03-10 11:48:12 +0800
commit65fea3ff58cdb012340d7e5755188df213df480a (patch)
tree269f5f677f6a86b8b9e75eb01612c1830382b054 /src
parent4a845b2cd0e771b39b778daf4941e5c02fa8e6b8 (diff)
downloademacs-65fea3ff58cdb012340d7e5755188df213df480a.tar.gz
emacs-65fea3ff58cdb012340d7e5755188df213df480a.zip
Fix menu bar activation on PGTK
* src/gtkutil.c (menu_bar_button_pressed_cb): Only update menu bar if no menu is active, and the event window is not the widget window itself. Also make menu in use. * src/pgtkmenu.c (popup_deactivate_callback): Make menu not in use. * src/xdisp.c (redisplay_internal): Return if popup_activated also on PGTK.
Diffstat (limited to 'src')
-rw-r--r--src/gtkutil.c9
-rw-r--r--src/pgtkmenu.c4
-rw-r--r--src/xdisp.c6
3 files changed, 11 insertions, 8 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 2a647810886..1b4ecaf9492 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3282,8 +3282,13 @@ menu_bar_button_pressed_cb (GtkWidget *widget, GdkEvent *event,
3282{ 3282{
3283 struct frame *f = user_data; 3283 struct frame *f = user_data;
3284 3284
3285 if (event->button.button < 4) 3285 if (event->button.button < 4
3286 set_frame_menubar (f, true); 3286 && event->button.window != gtk_widget_get_window (widget)
3287 && !popup_activated ())
3288 {
3289 pgtk_menu_set_in_use (true);
3290 set_frame_menubar (f, true);
3291 }
3287 3292
3288 return false; 3293 return false;
3289} 3294}
diff --git a/src/pgtkmenu.c b/src/pgtkmenu.c
index 7a3bfea4518..bd63af3b223 100644
--- a/src/pgtkmenu.c
+++ b/src/pgtkmenu.c
@@ -43,7 +43,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
43#include <gtk/gtk.h> 43#include <gtk/gtk.h>
44 44
45/* Flag which when set indicates a dialog or menu has been posted by 45/* Flag which when set indicates a dialog or menu has been posted by
46 Xt on behalf of one of the widget sets. */ 46 GTK on behalf of one of the widget sets. */
47static int popup_activated_flag; 47static int popup_activated_flag;
48 48
49/* Set menu_items_inuse so no other popup menu or dialog is created. */ 49/* Set menu_items_inuse so no other popup menu or dialog is created. */
@@ -132,7 +132,7 @@ pgtk_activate_menubar (struct frame *f)
132static void 132static void
133popup_deactivate_callback (GtkWidget *widget, gpointer client_data) 133popup_deactivate_callback (GtkWidget *widget, gpointer client_data)
134{ 134{
135 popup_activated_flag = 0; 135 pgtk_menu_set_in_use (false);
136} 136}
137 137
138/* Function that finds the frame for WIDGET and shows the HELP text 138/* Function that finds the frame for WIDGET and shows the HELP text
diff --git a/src/xdisp.c b/src/xdisp.c
index acb9cb7283c..5cb58391dde 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -16037,11 +16037,9 @@ redisplay_internal (void)
16037 if (!fr->glyphs_initialized_p) 16037 if (!fr->glyphs_initialized_p)
16038 return; 16038 return;
16039 16039
16040#if defined (USE_X_TOOLKIT) || (defined (USE_GTK) && !defined (HAVE_PGTK)) || defined (HAVE_NS) 16040#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS)
16041 if (popup_activated ()) 16041 if (popup_activated ())
16042 { 16042 return;
16043 return;
16044 }
16045#endif 16043#endif
16046 16044
16047#if defined (HAVE_HAIKU) 16045#if defined (HAVE_HAIKU)