[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 90742d7b01 2/2: Fix crashes when trying to pop up a menu on GTK 2
From: |
Po Lu |
Subject: |
master 90742d7b01 2/2: Fix crashes when trying to pop up a menu on GTK 2 |
Date: |
Tue, 15 Mar 2022 00:15:53 -0400 (EDT) |
branch: master
commit 90742d7b01366418f76d7bd08b19719901997903
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Fix crashes when trying to pop up a menu on GTK 2
* src/xterm.c (handle_one_xevent): Respect finish when
dispatching copy.
---
src/xterm.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/xterm.c b/src/xterm.c
index e48592210f..fc90e37043 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -12533,15 +12533,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
if (popup_activated ()
&& xev->evtype == XI_ButtonRelease)
- {
- *finish = X_EVENT_DROP;
- gtk_main_do_event (copy);
- gdk_event_free (copy);
- goto XI_OTHER;
- }
-
- gtk_main_do_event (copy);
- gdk_event_free (copy);
+ goto XI_OTHER;
#endif
#ifdef HAVE_XINPUT2_1
@@ -13717,6 +13709,16 @@ handle_one_xevent (struct x_display_info *dpyinfo,
}
unblock_input ();
#endif /* USE_X_TOOLKIT */
+#if defined USE_GTK && !defined HAVE_GTK3 && defined HAVE_XINPUT2
+ if (*finish != X_EVENT_DROP && copy)
+ {
+ gtk_main_do_event (copy);
+ *finish = X_EVENT_DROP;
+ }
+
+ if (copy)
+ gdk_event_free (copy);
+#endif
break;
}