aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1995-07-17 23:42:42 +0000
committerKarl Heuer1995-07-17 23:42:42 +0000
commitf32538544fea18f0afbc192487b39f4c40df08c7 (patch)
tree4aca53890c756ec83fab7f0324e75af4a9a2ecb4 /src
parent33487cc80b0d0280c5dcffec27d897f370cc037f (diff)
downloademacs-f32538544fea18f0afbc192487b39f4c40df08c7.tar.gz
emacs-f32538544fea18f0afbc192487b39f4c40df08c7.zip
(mouse_moved): Variable deleted.
(kbd_buffer_get_event, readable_events): Check mouse_moved in all frames. Check do_mouse_tracking for non-nil ness. (Ftrack_mouse): Set do_mouse_tracking to t. (kbd_buffer_get_event): Discard a selection_clear_event before processing it.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 9a6b7cf667d..dd9840bc1a9 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -398,20 +398,11 @@ static volatile struct input_event *kbd_store_ptr;
398 dequeuing functions? Such a flag could be screwed up by interrupts 398 dequeuing functions? Such a flag could be screwed up by interrupts
399 at inopportune times. */ 399 at inopportune times. */
400 400
401/* If this flag is a frame, we check mouse_moved to see when the 401/* If this flag is non-nil, we check mouse_moved to see when the
402 mouse moves, and motion events will appear in the input stream. 402 mouse moves, and motion events will appear in the input stream.
403 Otherwise, mouse motion is ignored. */ 403 Otherwise, mouse motion is ignored. */
404static Lisp_Object do_mouse_tracking; 404static Lisp_Object do_mouse_tracking;
405 405
406#ifdef HAVE_MOUSE
407/* The window system handling code should set this if the mouse has
408 moved since the last call to the mouse_position_hook. Calling that
409 hook should clear this. Code assumes that if this is set, it can
410 call mouse_position_hook to get the promised position, so don't set
411 it unless you're prepared to substantiate the claim! */
412int mouse_moved;
413#endif /* HAVE_MOUSE */
414
415/* Symbols to head events. */ 406/* Symbols to head events. */
416Lisp_Object Qmouse_movement; 407Lisp_Object Qmouse_movement;
417Lisp_Object Qscroll_bar_movement; 408Lisp_Object Qscroll_bar_movement;
@@ -2273,12 +2264,29 @@ Normally, mouse motion is ignored.")
2273 2264
2274 record_unwind_protect (tracking_off, do_mouse_tracking); 2265 record_unwind_protect (tracking_off, do_mouse_tracking);
2275 2266
2276 XSETFRAME (do_mouse_tracking, selected_frame); 2267 do_mouse_tracking = Qt;
2277 2268
2278 val = Fprogn (args); 2269 val = Fprogn (args);
2279 return unbind_to (count, val); 2270 return unbind_to (count, val);
2280} 2271}
2281 2272
2273/* If mouse has moved on some frame, return one of those frames.
2274 Return 0 otherwise. */
2275
2276static FRAME_PTR
2277some_mouse_moved ()
2278{
2279 Lisp_Object tail, frame;
2280
2281 FOR_EACH_FRAME (tail, frame)
2282 {
2283 if (XFRAME (frame)->mouse_moved)
2284 return XFRAME (frame);
2285 }
2286
2287 return 0;
2288}
2289
2282#endif /* HAVE_MOUSE */ 2290#endif /* HAVE_MOUSE */
2283 2291
2284/* Low level keyboard/mouse input. 2292/* Low level keyboard/mouse input.
@@ -2295,7 +2303,7 @@ readable_events ()
2295 if (kbd_fetch_ptr != kbd_store_ptr) 2303 if (kbd_fetch_ptr != kbd_store_ptr)
2296 return 1; 2304 return 1;
2297#ifdef HAVE_MOUSE 2305#ifdef HAVE_MOUSE
2298 if (FRAMEP (do_mouse_tracking) && mouse_moved) 2306 if (!NILP (do_mouse_tracking) && some_mouse_moved ())
2299 return 1; 2307 return 1;
2300#endif 2308#endif
2301 if (single_kboard) 2309 if (single_kboard)
@@ -2480,7 +2488,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
2480 if (kbd_fetch_ptr != kbd_store_ptr) 2488 if (kbd_fetch_ptr != kbd_store_ptr)
2481 break; 2489 break;
2482#ifdef HAVE_MOUSE 2490#ifdef HAVE_MOUSE
2483 if (FRAMEP (do_mouse_tracking) && mouse_moved) 2491 if (!NILP (do_mouse_tracking) && some_mouse_moved ())
2484 break; 2492 break;
2485#endif 2493#endif
2486 2494
@@ -2502,7 +2510,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
2502 if (kbd_fetch_ptr != kbd_store_ptr) 2510 if (kbd_fetch_ptr != kbd_store_ptr)
2503 break; 2511 break;
2504#ifdef HAVE_MOUSE 2512#ifdef HAVE_MOUSE
2505 if (FRAMEP (do_mouse_tracking) && mouse_moved) 2513 if (!NILP (do_mouse_tracking) && some_mouse_moved ())
2506 break; 2514 break;
2507#endif 2515#endif
2508 { 2516 {
@@ -2565,8 +2573,8 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
2565 else if (event->kind == selection_clear_event) 2573 else if (event->kind == selection_clear_event)
2566 { 2574 {
2567#ifdef HAVE_X11 2575#ifdef HAVE_X11
2568 x_handle_selection_clear (event);
2569 kbd_fetch_ptr = event + 1; 2576 kbd_fetch_ptr = event + 1;
2577 x_handle_selection_clear (event);
2570#else 2578#else
2571 /* We're getting selection request events, but we don't have 2579 /* We're getting selection request events, but we don't have
2572 a window system. */ 2580 a window system. */
@@ -2663,9 +2671,9 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
2663 } 2671 }
2664#ifdef HAVE_MOUSE 2672#ifdef HAVE_MOUSE
2665 /* Try generating a mouse motion event. */ 2673 /* Try generating a mouse motion event. */
2666 else if (FRAMEP (do_mouse_tracking) && mouse_moved) 2674 else if (!NILP (do_mouse_tracking) && some_mouse_moved ())
2667 { 2675 {
2668 FRAME_PTR f = XFRAME (do_mouse_tracking); 2676 FRAME_PTR f = some_mouse_moved ();
2669 Lisp_Object bar_window; 2677 Lisp_Object bar_window;
2670 enum scroll_bar_part part; 2678 enum scroll_bar_part part;
2671 Lisp_Object x, y; 2679 Lisp_Object x, y;