diff options
| author | Pavel Janík | 2002-04-01 13:43:58 +0000 |
|---|---|---|
| committer | Pavel Janík | 2002-04-01 13:43:58 +0000 |
| commit | 5bc624834eeabb49b6c319d08bbd46f5777a9baa (patch) | |
| tree | f999813a806ab0483e278558ad4f599fb0527d94 /src | |
| parent | a697f886b4a69c059bc9340f49c2b2ae335d1385 (diff) | |
| download | emacs-5bc624834eeabb49b6c319d08bbd46f5777a9baa.tar.gz emacs-5bc624834eeabb49b6c319d08bbd46f5777a9baa.zip | |
(autoselect_window_p): Renamed from `x_autoselect_window_p'.
(last_window): New variable.
(XTread_socket): Generate SELECT_WINDOW_EVENTs.
(note_mouse_movement): Remove reimplemented code in #if 0.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 62 |
1 files changed, 35 insertions, 27 deletions
diff --git a/src/xterm.c b/src/xterm.c index 3c0abbecf16..73e987531a9 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -255,7 +255,10 @@ static int any_help_event_p; | |||
| 255 | 255 | ||
| 256 | /* Non-zero means autoselect window with the mouse cursor. */ | 256 | /* Non-zero means autoselect window with the mouse cursor. */ |
| 257 | 257 | ||
| 258 | int x_autoselect_window_p; | 258 | int autoselect_window_p; |
| 259 | |||
| 260 | /* Last window where we saw the mouse. Used by autoselect-window. */ | ||
| 261 | static Lisp_Object last_window; | ||
| 259 | 262 | ||
| 260 | /* Non-zero means draw block and hollow cursor as wide as the glyph | 263 | /* Non-zero means draw block and hollow cursor as wide as the glyph |
| 261 | under it. For example, if a block cursor is over a tab, it will be | 264 | under it. For example, if a block cursor is over a tab, it will be |
| @@ -6653,29 +6656,6 @@ note_mouse_movement (frame, event) | |||
| 6653 | last_mouse_motion_event = *event; | 6656 | last_mouse_motion_event = *event; |
| 6654 | XSETFRAME (last_mouse_motion_frame, frame); | 6657 | XSETFRAME (last_mouse_motion_frame, frame); |
| 6655 | 6658 | ||
| 6656 | #if 0 /* Lisp must not be called asynchronously, so this must | ||
| 6657 | not be done. */ | ||
| 6658 | if (x_autoselect_window_p) | ||
| 6659 | { | ||
| 6660 | int area; | ||
| 6661 | Lisp_Object window; | ||
| 6662 | static Lisp_Object last_window; | ||
| 6663 | |||
| 6664 | window = window_from_coordinates (frame, XINT (event->x), XINT (event->y), &area, 0); | ||
| 6665 | |||
| 6666 | /* Window will be selected only when it is not selected now and | ||
| 6667 | last mouse movement event was not in it. Minibuffer window | ||
| 6668 | will be selected iff it is active. */ | ||
| 6669 | if (!EQ (window, last_window) | ||
| 6670 | && !EQ (window, selected_window) | ||
| 6671 | && (!MINI_WINDOW_P (XWINDOW (window)) | ||
| 6672 | || (EQ (window, minibuf_window) && minibuf_level > 0))) | ||
| 6673 | Fselect_window (window); | ||
| 6674 | |||
| 6675 | last_window=window; | ||
| 6676 | } | ||
| 6677 | #endif | ||
| 6678 | |||
| 6679 | if (event->window != FRAME_X_WINDOW (frame)) | 6659 | if (event->window != FRAME_X_WINDOW (frame)) |
| 6680 | { | 6660 | { |
| 6681 | frame->mouse_moved = 1; | 6661 | frame->mouse_moved = 1; |
| @@ -10895,7 +10875,35 @@ XTread_socket (sd, bufp, numchars, expected) | |||
| 10895 | } | 10875 | } |
| 10896 | 10876 | ||
| 10897 | if (f) | 10877 | if (f) |
| 10898 | note_mouse_movement (f, &event.xmotion); | 10878 | { |
| 10879 | |||
| 10880 | /* Generate SELECT_WINDOW_EVENTs when needed. */ | ||
| 10881 | if (autoselect_window_p) | ||
| 10882 | { | ||
| 10883 | Lisp_Object window; | ||
| 10884 | int area; | ||
| 10885 | |||
| 10886 | window = window_from_coordinates (f, | ||
| 10887 | XINT (event.xmotion.x), XINT (event.xmotion.y), | ||
| 10888 | &area, 0); | ||
| 10889 | |||
| 10890 | /* Window will be selected only when it is not selected now and | ||
| 10891 | last mouse movement event was not in it. Minibuffer window | ||
| 10892 | will be selected iff it is active. */ | ||
| 10893 | if (!EQ (window, last_window) | ||
| 10894 | && !EQ (window, selected_window) | ||
| 10895 | && numchars > 0) | ||
| 10896 | { | ||
| 10897 | bufp->kind = SELECT_WINDOW_EVENT; | ||
| 10898 | bufp->frame_or_window = window; | ||
| 10899 | bufp->arg = Qnil; | ||
| 10900 | ++bufp, ++count, --numchars; | ||
| 10901 | } | ||
| 10902 | |||
| 10903 | last_window=window; | ||
| 10904 | } | ||
| 10905 | note_mouse_movement (f, &event.xmotion); | ||
| 10906 | } | ||
| 10899 | else | 10907 | else |
| 10900 | { | 10908 | { |
| 10901 | #ifndef USE_TOOLKIT_SCROLL_BARS | 10909 | #ifndef USE_TOOLKIT_SCROLL_BARS |
| @@ -15108,9 +15116,9 @@ syms_of_xterm () | |||
| 15108 | staticpro (&previous_help_echo); | 15116 | staticpro (&previous_help_echo); |
| 15109 | help_echo_pos = -1; | 15117 | help_echo_pos = -1; |
| 15110 | 15118 | ||
| 15111 | DEFVAR_BOOL ("x-autoselect-window", &x_autoselect_window_p, | 15119 | DEFVAR_BOOL ("autoselect-window", &autoselect_window_p, |
| 15112 | doc: /* *Non-nil means autoselect window with mouse pointer. */); | 15120 | doc: /* *Non-nil means autoselect window with mouse pointer. */); |
| 15113 | x_autoselect_window_p = 0; | 15121 | autoselect_window_p = 0; |
| 15114 | 15122 | ||
| 15115 | DEFVAR_BOOL ("x-stretch-cursor", &x_stretch_cursor_p, | 15123 | DEFVAR_BOOL ("x-stretch-cursor", &x_stretch_cursor_p, |
| 15116 | doc: /* *Non-nil means draw block cursor as wide as the glyph under it. | 15124 | doc: /* *Non-nil means draw block cursor as wide as the glyph under it. |