diff options
| author | Po Lu | 2021-12-12 11:24:29 +0800 |
|---|---|---|
| committer | Po Lu | 2021-12-12 11:24:29 +0800 |
| commit | ae0f52b7b4bc3fa5c12db8d5ecf5d6fac917493d (patch) | |
| tree | c1144fd36ba4c45ec542d2a6d50427053cf794e9 | |
| parent | 0e69753ac142ef0f45ec14c8281ec4f76aea723b (diff) | |
| download | emacs-ae0f52b7b4bc3fa5c12db8d5ecf5d6fac917493d.tar.gz emacs-ae0f52b7b4bc3fa5c12db8d5ecf5d6fac917493d.zip | |
Prevent hangs when displaying a context menu on pgtk
* src/pgtkmenu.c (pgtk_menu_wait_for_event, popup_widget_loop):
Remove unnecessary workarounds.
| -rw-r--r-- | src/pgtkmenu.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/pgtkmenu.c b/src/pgtkmenu.c index 6f8f8720ded..40adfa55ea3 100644 --- a/src/pgtkmenu.c +++ b/src/pgtkmenu.c | |||
| @@ -68,24 +68,6 @@ pgtk_menu_set_in_use (bool in_use) | |||
| 68 | } | 68 | } |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | /* Wait for an X event to arrive or for a timer to expire. */ | ||
| 72 | |||
| 73 | static void | ||
| 74 | pgtk_menu_wait_for_event (void *data) | ||
| 75 | { | ||
| 76 | struct timespec next_time = timer_check (), *ntp; | ||
| 77 | |||
| 78 | if (!timespec_valid_p (next_time)) | ||
| 79 | ntp = 0; | ||
| 80 | else | ||
| 81 | ntp = &next_time; | ||
| 82 | |||
| 83 | /* Gtk3 have arrows on menus when they don't fit. When the | ||
| 84 | pointer is over an arrow, a timeout scrolls it a bit. Use | ||
| 85 | xg_select so that timeout gets triggered. */ | ||
| 86 | xg_select (0, NULL, NULL, NULL, ntp, NULL); | ||
| 87 | } | ||
| 88 | |||
| 89 | DEFUN ("x-menu-bar-open-internal", Fx_menu_bar_open_internal, Sx_menu_bar_open_internal, 0, 1, "i", | 71 | DEFUN ("x-menu-bar-open-internal", Fx_menu_bar_open_internal, Sx_menu_bar_open_internal, 0, 1, "i", |
| 90 | doc: /* Start key navigation of the menu bar in FRAME. | 72 | doc: /* Start key navigation of the menu bar in FRAME. |
| 91 | This initially opens the first menu bar item and you can then navigate with the | 73 | 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) | |||
| 131 | 113 | ||
| 132 | /* Process events in the Gtk event loop until done. */ | 114 | /* Process events in the Gtk event loop until done. */ |
| 133 | while (popup_activated_flag) | 115 | while (popup_activated_flag) |
| 134 | { | 116 | gtk_main_iteration (); |
| 135 | if (do_timers) | ||
| 136 | pgtk_menu_wait_for_event (0); | ||
| 137 | gtk_main_iteration (); | ||
| 138 | } | ||
| 139 | } | 117 | } |
| 140 | 118 | ||
| 141 | void | 119 | void |