1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-05 21:42:34 -08:00

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.
This commit is contained in:
Po Lu 2022-03-10 11:48:12 +08:00
parent 4a845b2cd0
commit 65fea3ff58
3 changed files with 11 additions and 8 deletions

View file

@ -3282,8 +3282,13 @@ menu_bar_button_pressed_cb (GtkWidget *widget, GdkEvent *event,
{
struct frame *f = user_data;
if (event->button.button < 4)
set_frame_menubar (f, true);
if (event->button.button < 4
&& event->button.window != gtk_widget_get_window (widget)
&& !popup_activated ())
{
pgtk_menu_set_in_use (true);
set_frame_menubar (f, true);
}
return false;
}

View file

@ -43,7 +43,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include <gtk/gtk.h>
/* Flag which when set indicates a dialog or menu has been posted by
Xt on behalf of one of the widget sets. */
GTK on behalf of one of the widget sets. */
static int popup_activated_flag;
/* Set menu_items_inuse so no other popup menu or dialog is created. */
@ -132,7 +132,7 @@ pgtk_activate_menubar (struct frame *f)
static void
popup_deactivate_callback (GtkWidget *widget, gpointer client_data)
{
popup_activated_flag = 0;
pgtk_menu_set_in_use (false);
}
/* Function that finds the frame for WIDGET and shows the HELP text

View file

@ -16037,11 +16037,9 @@ redisplay_internal (void)
if (!fr->glyphs_initialized_p)
return;
#if defined (USE_X_TOOLKIT) || (defined (USE_GTK) && !defined (HAVE_PGTK)) || defined (HAVE_NS)
#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS)
if (popup_activated ())
{
return;
}
return;
#endif
#if defined (HAVE_HAIKU)