aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1996-07-30 21:10:40 +0000
committerRichard M. Stallman1996-07-30 21:10:40 +0000
commit2237cac94952a62eeae0438c23ea1986fb4a7663 (patch)
tree2da42eb57f7e5453981c649e142e3f0eb14d2081 /src
parent95c0d3a7dd4238b8bb68fade83006eda950b8da3 (diff)
downloademacs-2237cac94952a62eeae0438c23ea1986fb4a7663.tar.gz
emacs-2237cac94952a62eeae0438c23ea1986fb4a7663.zip
(XTread_socket): Pass keys in menu bar to toolkit alone
only for Motif. (XTread_socket): Fixing previous change: Clear last_mouse_press_frame on non-menu-bar ButtonPress. Always use last_mouse_press_frame as frame for ButtonRelease. But ignore the event if frame's output_data.x is null. Save the ButtonRelease only if USE_MOTIF. (last_mouse_press_frame): This is now a Lisp object. (syms_of_xterm): Initialize and staticpro it.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 16711587b5c..ea3c8899d59 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -195,9 +195,10 @@ static int curs_y;
195 195
196/* Where the mouse was last time we reported a mouse event. */ 196/* Where the mouse was last time we reported a mouse event. */
197static FRAME_PTR last_mouse_frame; 197static FRAME_PTR last_mouse_frame;
198static FRAME_PTR last_mouse_press_frame;
199static XRectangle last_mouse_glyph; 198static XRectangle last_mouse_glyph;
200 199
200static Lisp_Object last_mouse_press_frame;
201
201/* The scroll bar in which the last X motion event occurred. 202/* The scroll bar in which the last X motion event occurred.
202 203
203 If the last X motion event occurred in a scroll bar, we set this 204 If the last X motion event occurred in a scroll bar, we set this
@@ -3633,7 +3634,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3633 unsigned char copy_buffer[81]; 3634 unsigned char copy_buffer[81];
3634 int modifiers; 3635 int modifiers;
3635 3636
3636#ifdef USE_X_TOOLKIT 3637#ifdef USE_MOTIF
3637 if (lw_window_is_in_menubar (event.xkey.window, 3638 if (lw_window_is_in_menubar (event.xkey.window,
3638 f->output_data.x->menubar_widget 3639 f->output_data.x->menubar_widget
3639 )) 3640 ))
@@ -3641,7 +3642,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3641 SET_SAVED_KEY_EVENT; 3642 SET_SAVED_KEY_EVENT;
3642 break; 3643 break;
3643 } 3644 }
3644#endif /* USE_X_TOOLKIT */ 3645#endif /* USE_MOTIF */
3645 3646
3646 event.xkey.state 3647 event.xkey.state
3647 |= x_emacs_to_x_modifiers (FRAME_X_DISPLAY_INFO (f), 3648 |= x_emacs_to_x_modifiers (FRAME_X_DISPLAY_INFO (f),
@@ -4048,17 +4049,26 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
4048 && event.xbutton.same_screen) 4049 && event.xbutton.same_screen)
4049 { 4050 {
4050 SET_SAVED_BUTTON_EVENT; 4051 SET_SAVED_BUTTON_EVENT;
4051 last_mouse_press_frame = f; 4052 XSETFRAME (last_mouse_press_frame, f);
4053 }
4054 else if (event.type == ButtonPress)
4055 {
4056 last_mouse_press_frame = Qnil;
4052 } 4057 }
4058#ifdef USE_MOTIF /* This should do not harm for Lucid,
4059 but I am trying to be cautious. */
4053 else if (event.type == ButtonRelease) 4060 else if (event.type == ButtonRelease)
4054 { 4061 {
4055 if (!f) 4062 if (!NILP (last_mouse_press_frame))
4056 f = last_mouse_press_frame;
4057 if (f)
4058 { 4063 {
4059 SET_SAVED_BUTTON_EVENT; 4064 f = XFRAME (last_mouse_press_frame);
4065 if (f->output_data.x)
4066 {
4067 SET_SAVED_BUTTON_EVENT;
4068 }
4060 } 4069 }
4061 } 4070 }
4071#endif /* USE_MOTIF */
4062 else 4072 else
4063 goto OTHER; 4073 goto OTHER;
4064#endif /* USE_X_TOOLKIT */ 4074#endif /* USE_X_TOOLKIT */
@@ -6223,6 +6233,9 @@ syms_of_xterm ()
6223 6233
6224 staticpro (&Qvendor_specific_keysyms); 6234 staticpro (&Qvendor_specific_keysyms);
6225 Qvendor_specific_keysyms = intern ("vendor-specific-keysyms"); 6235 Qvendor_specific_keysyms = intern ("vendor-specific-keysyms");
6236
6237 staticpro (&last_mouse_press_frame);
6238 last_mouse_press_frame = Qnil;
6226} 6239}
6227 6240
6228#endif /* not HAVE_X_WINDOWS */ 6241#endif /* not HAVE_X_WINDOWS */