summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-11-15 23:15:49 +0000
committerRichard M. Stallman <rms@gnu.org>1995-11-15 23:15:49 +0000
commit91375f8fc631d075be56edd5422151ac26fb8465 (patch)
tree4be8c26e2d77f2a637bdfdc38cac2d600a982e73
parent4f35820fbc8301798ca783bcbc6ac6a69f658be8 (diff)
downloademacs-91375f8fc631d075be56edd5422151ac26fb8465.tar.gz
(XTread_socket): Verify a ButtonPress was actually in the
menu bar before generating a menu_bar_activate_event event.
-rw-r--r--src/xterm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/xterm.c b/src/xterm.c
index eb79e883d02..c149866c1a9 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4056,7 +4056,14 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
Instead, save it away
and we will pass it to Xt from kbd_buffer_get_event.
That way, we can run some Lisp code first. */
- if (f && event.type == ButtonPress)
+ if (f && event.type == ButtonPress
+ /* Verify the event is really within the menu bar
+ and not just sent to it due to grabbing. */
+ && event.xbutton.x >= 0
+ && event.xbutton.x < f->output_data.x->pixel_width
+ && event.xbutton.y >= 0
+ && event.xbutton.y < f->output_data.x->menubar_height
+ && event.xbutton.same_screen)
{
if (f->output_data.x->saved_button_event == 0)
f->output_data.x->saved_button_event