]> git.eshelyaron.com Git - emacs.git/commitdiff
Prevent hangs when displaying a context menu on pgtk
authorPo Lu <luangruo@yahoo.com>
Sun, 12 Dec 2021 03:24:29 +0000 (11:24 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 12 Dec 2021 03:24:29 +0000 (11:24 +0800)
* src/pgtkmenu.c (pgtk_menu_wait_for_event, popup_widget_loop):
Remove unnecessary workarounds.

src/pgtkmenu.c

index 6f8f8720ded1c38e57a943a82d65db6d6798bc3a..40adfa55ea3e2941dc93b086832284d5c6c690e6 100644 (file)
@@ -68,24 +68,6 @@ pgtk_menu_set_in_use (bool in_use)
   }
 }
 
-/* Wait for an X event to arrive or for a timer to expire.  */
-
-static void
-pgtk_menu_wait_for_event (void *data)
-{
-  struct timespec next_time = timer_check (), *ntp;
-
-  if (!timespec_valid_p (next_time))
-    ntp = 0;
-  else
-    ntp = &next_time;
-
-  /* Gtk3 have arrows on menus when they don't fit.  When the
-     pointer is over an arrow, a timeout scrolls it a bit.  Use
-     xg_select so that timeout gets triggered.  */
-  xg_select (0, NULL, NULL, NULL, ntp, NULL);
-}
-
 DEFUN ("x-menu-bar-open-internal", Fx_menu_bar_open_internal, Sx_menu_bar_open_internal, 0, 1, "i",
        doc: /* Start key navigation of the menu bar in FRAME.
        This initially opens the first menu bar item and you can then navigate with the
@@ -131,11 +113,7 @@ popup_widget_loop (bool do_timers, GtkWidget * widget)
 
   /* Process events in the Gtk event loop until done.  */
   while (popup_activated_flag)
-    {
-      if (do_timers)
-       pgtk_menu_wait_for_event (0);
-      gtk_main_iteration ();
-    }
+    gtk_main_iteration ();
 }
 
 void