aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-07-07 03:03:34 +0000
committerRichard M. Stallman1994-07-07 03:03:34 +0000
commitfb3b7de5e991e7f9b35298fa29de8288dba4038f (patch)
treefae075d2915a2254ebf1d1a3ceb5dc0f0ca9c8c1 /src
parent309848baf427f80a818094870fe218c0a045864c (diff)
downloademacs-fb3b7de5e991e7f9b35298fa29de8288dba4038f.tar.gz
emacs-fb3b7de5e991e7f9b35298fa29de8288dba4038f.zip
(XTread_socket, construct_menu_click) [USE_X_TOOLKIT]:
Update x_mouse_grabbed and Vmouse_depressed. (x_make_frame_visible): In x_sync loop at the end, every fourth time, sleep for 1/4 second.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/src/xterm.c b/src/xterm.c
index d859ffdfee4..56c37ae1325 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2061,6 +2061,15 @@ construct_menu_click (result, event, f)
2061 XSET (result->x, Lisp_Int, event->x); 2061 XSET (result->x, Lisp_Int, event->x);
2062 XSET (result->y, Lisp_Int, -1); 2062 XSET (result->y, Lisp_Int, -1);
2063 XSET (result->frame_or_window, Lisp_Frame, f); 2063 XSET (result->frame_or_window, Lisp_Frame, f);
2064
2065 /* Notice if the mouse is still grabbed. */
2066 if (event->type == ButtonPress)
2067 {
2068 if (! x_mouse_grabbed)
2069 Vmouse_depressed = Qt;
2070 x_mouse_grabbed |= (1 << event->button);
2071 last_mouse_frame = f;
2072 }
2064} 2073}
2065 2074
2066/* Function to report a mouse movement to the mainstream Emacs code. 2075/* Function to report a mouse movement to the mainstream Emacs code.
@@ -2385,9 +2394,15 @@ show_mouse_face (hl)
2385 int width = window_internal_width (w); 2394 int width = window_internal_width (w);
2386 FRAME_PTR f = XFRAME (WINDOW_FRAME (w)); 2395 FRAME_PTR f = XFRAME (WINDOW_FRAME (w));
2387 int i; 2396 int i;
2388 int curs_x = f->phys_cursor_x;
2389 int curs_y = f->phys_cursor_y;
2390 int cursor_off = 0; 2397 int cursor_off = 0;
2398 int old_curs_x = curs_x;
2399 int old_curs_y = curs_y;
2400
2401 /* Set these variables temporarily
2402 so that if we have to turn the cursor off and on again
2403 we will put it back at the same place. */
2404 curs_x = f->phys_cursor_x;
2405 curs_y = f->phys_cursor_y;
2391 2406
2392 for (i = mouse_face_beg_row; i <= mouse_face_end_row; i++) 2407 for (i = mouse_face_beg_row; i <= mouse_face_end_row; i++)
2393 { 2408 {
@@ -2417,6 +2432,9 @@ show_mouse_face (hl)
2417 if (cursor_off) 2432 if (cursor_off)
2418 x_display_cursor (f, 1); 2433 x_display_cursor (f, 1);
2419 2434
2435 curs_x = old_curs_x;
2436 curs_y = old_curs_y;
2437
2420 /* Change the mouse cursor according to the value of HL. */ 2438 /* Change the mouse cursor according to the value of HL. */
2421 if (hl > 0) 2439 if (hl > 0)
2422 XDefineCursor (XDISPLAY FRAME_X_WINDOW (f), f->display.x->cross_cursor); 2440 XDefineCursor (XDISPLAY FRAME_X_WINDOW (f), f->display.x->cross_cursor);
@@ -4206,8 +4224,8 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
4206 } 4224 }
4207 else 4225 else
4208 { 4226 {
4209 struct scroll_bar *bar = 4227 struct scroll_bar *bar
4210 x_window_to_scroll_bar (event.xbutton.window); 4228 = x_window_to_scroll_bar (event.xbutton.window);
4211 4229
4212 if (bar) 4230 if (bar)
4213 x_scroll_bar_handle_click (bar, &event, &emacs_event); 4231 x_scroll_bar_handle_click (bar, &event, &emacs_event);
@@ -4218,6 +4236,12 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
4218 if (f && event.type == ButtonPress) 4236 if (f && event.type == ButtonPress)
4219 construct_menu_click (&emacs_event, 4237 construct_menu_click (&emacs_event,
4220 &event, f); 4238 &event, f);
4239 else if (f)
4240 {
4241 x_mouse_grabbed &= ~(1 << event.xbutton.button);
4242 if (!x_mouse_grabbed)
4243 Vmouse_depressed = Qnil;
4244 }
4221 } 4245 }
4222#endif /* USE_X_TOOLKIT */ 4246#endif /* USE_X_TOOLKIT */
4223 } 4247 }