diff options
| author | Richard M. Stallman | 1994-10-20 05:33:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-10-20 05:33:22 +0000 |
| commit | a9d77f1fb76d36c0612f4741c7bc267db3bb56cc (patch) | |
| tree | 70a6deb5a054804c673fe04b99d2ac52a1654d0f /src/keyboard.c | |
| parent | 2408b3a17cddf1b3a9c4ff3ea0c49180fefae054 (diff) | |
| download | emacs-a9d77f1fb76d36c0612f4741c7bc267db3bb56cc.tar.gz emacs-a9d77f1fb76d36c0612f4741c7bc267db3bb56cc.zip | |
(do_mouse_tracking): Now a FRAME_PTR.
(EVENT_QUEUES_EMPTY, Ftrack_mouse, tracking_off): Changed accordingly.
(kbd_buffer_get_event): Let do_mouse_tracking specify the display
for mouse tracking.
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index f64f8d43808..8b305381c06 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -374,10 +374,10 @@ static volatile struct input_event *kbd_store_ptr; | |||
| 374 | dequeuing functions? Such a flag could be screwed up by interrupts | 374 | dequeuing functions? Such a flag could be screwed up by interrupts |
| 375 | at inopportune times. */ | 375 | at inopportune times. */ |
| 376 | 376 | ||
| 377 | /* If this flag is non-zero, we check mouse_moved to see when the | 377 | /* If this flag is a frame, we check mouse_moved to see when the |
| 378 | mouse moves, and motion events will appear in the input stream. If | 378 | mouse moves, and motion events will appear in the input stream. |
| 379 | it is zero, mouse motion is ignored. */ | 379 | Otherwise, mouse motion is ignored. */ |
| 380 | static int do_mouse_tracking; | 380 | static Lisp_Object do_mouse_tracking; |
| 381 | 381 | ||
| 382 | /* The window system handling code should set this if the mouse has | 382 | /* The window system handling code should set this if the mouse has |
| 383 | moved since the last call to the mouse_position_hook. Calling that | 383 | moved since the last call to the mouse_position_hook. Calling that |
| @@ -392,7 +392,8 @@ int mouse_moved; | |||
| 392 | is readable input; all the events in the queue might be button-up | 392 | is readable input; all the events in the queue might be button-up |
| 393 | events, and do_mouse_tracking might be off. */ | 393 | events, and do_mouse_tracking might be off. */ |
| 394 | #define EVENT_QUEUES_EMPTY \ | 394 | #define EVENT_QUEUES_EMPTY \ |
| 395 | ((kbd_fetch_ptr == kbd_store_ptr) && (!do_mouse_tracking || !mouse_moved)) | 395 | ((kbd_fetch_ptr == kbd_store_ptr) \ |
| 396 | && (! FRAMEP (do_mouse_tracking) || !mouse_moved)) | ||
| 396 | 397 | ||
| 397 | 398 | ||
| 398 | /* Symbols to head events. */ | 399 | /* Symbols to head events. */ |
| @@ -1889,13 +1890,14 @@ restore_getcjmp (temp) | |||
| 1889 | 1890 | ||
| 1890 | /* Restore mouse tracking enablement. See Ftrack_mouse for the only use | 1891 | /* Restore mouse tracking enablement. See Ftrack_mouse for the only use |
| 1891 | of this function. */ | 1892 | of this function. */ |
| 1893 | |||
| 1892 | static Lisp_Object | 1894 | static Lisp_Object |
| 1893 | tracking_off (old_value) | 1895 | tracking_off (old_value) |
| 1894 | Lisp_Object old_value; | 1896 | Lisp_Object old_value; |
| 1895 | { | 1897 | { |
| 1896 | if (! XFASTINT (old_value)) | 1898 | if (! XFASTINT (old_value)) |
| 1897 | { | 1899 | { |
| 1898 | do_mouse_tracking = 0; | 1900 | do_mouse_tracking = Qnil; |
| 1899 | 1901 | ||
| 1900 | /* Redisplay may have been preempted because there was input | 1902 | /* Redisplay may have been preempted because there was input |
| 1901 | available, and it assumes it will be called again after the | 1903 | available, and it assumes it will be called again after the |
| @@ -1922,13 +1924,12 @@ Normally, mouse motion is ignored.") | |||
| 1922 | int count = specpdl_ptr - specpdl; | 1924 | int count = specpdl_ptr - specpdl; |
| 1923 | Lisp_Object val; | 1925 | Lisp_Object val; |
| 1924 | 1926 | ||
| 1925 | XSETINT (val, do_mouse_tracking); | 1927 | record_unwind_protect (tracking_off, do_mouse_tracking); |
| 1926 | record_unwind_protect (tracking_off, val); | ||
| 1927 | 1928 | ||
| 1928 | if (!input_pending && !detect_input_pending ()) | 1929 | if (!input_pending && !detect_input_pending ()) |
| 1929 | prepare_menu_bars (); | 1930 | prepare_menu_bars (); |
| 1930 | 1931 | ||
| 1931 | do_mouse_tracking = 1; | 1932 | XSETFRAME (do_mouse_tracking, selected_frame); |
| 1932 | 1933 | ||
| 1933 | val = Fprogn (args); | 1934 | val = Fprogn (args); |
| 1934 | return unbind_to (count, val); | 1935 | return unbind_to (count, val); |
| @@ -2200,9 +2201,9 @@ kbd_buffer_get_event () | |||
| 2200 | } | 2201 | } |
| 2201 | } | 2202 | } |
| 2202 | /* Try generating a mouse motion event. */ | 2203 | /* Try generating a mouse motion event. */ |
| 2203 | else if (do_mouse_tracking && mouse_moved) | 2204 | else if (FRAMEP (do_mouse_tracking) && mouse_moved) |
| 2204 | { | 2205 | { |
| 2205 | FRAME_PTR f = 0; | 2206 | FRAME_PTR f = XFRAME (do_mouse_tracking); |
| 2206 | Lisp_Object bar_window; | 2207 | Lisp_Object bar_window; |
| 2207 | enum scroll_bar_part part; | 2208 | enum scroll_bar_part part; |
| 2208 | Lisp_Object x, y; | 2209 | Lisp_Object x, y; |
| @@ -5877,7 +5878,7 @@ init_keyboard () | |||
| 5877 | recent_keys_index = 0; | 5878 | recent_keys_index = 0; |
| 5878 | kbd_fetch_ptr = kbd_buffer; | 5879 | kbd_fetch_ptr = kbd_buffer; |
| 5879 | kbd_store_ptr = kbd_buffer; | 5880 | kbd_store_ptr = kbd_buffer; |
| 5880 | do_mouse_tracking = 0; | 5881 | do_mouse_tracking = Qnil; |
| 5881 | input_pending = 0; | 5882 | input_pending = 0; |
| 5882 | 5883 | ||
| 5883 | #ifdef MULTI_FRAME | 5884 | #ifdef MULTI_FRAME |