comparison src/xterm.c @ 44301:1892db006468

(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.
author Pavel Janík <Pavel@Janik.cz>
date Mon, 01 Apr 2002 13:43:58 +0000
parents 8ea0c09f5cb8
children 90abb8476f40
comparison
equal deleted inserted replaced
44300:21286349d285 44301:1892db006468
253 253
254 static int any_help_event_p; 254 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
262 drawn as wide as that tab on the display. */ 265 drawn as wide as that tab on the display. */
263 266
6650 XMotionEvent *event; 6653 XMotionEvent *event;
6651 { 6654 {
6652 last_mouse_movement_time = event->time; 6655 last_mouse_movement_time = event->time;
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
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 6658
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;
6682 last_mouse_scroll_bar = Qnil; 6662 last_mouse_scroll_bar = Qnil;
10893 dpyinfo->mouse_face_hidden = 0; 10873 dpyinfo->mouse_face_hidden = 0;
10894 clear_mouse_face (dpyinfo); 10874 clear_mouse_face (dpyinfo);
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
10902 struct scroll_bar *bar 10910 struct scroll_bar *bar
10903 = x_window_to_scroll_bar (event.xmotion.window); 10911 = x_window_to_scroll_bar (event.xmotion.window);
15106 staticpro (&help_echo_window); 15114 staticpro (&help_echo_window);
15107 previous_help_echo = Qnil; 15115 previous_help_echo = Qnil;
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.
15117 For example, if a block cursor is over a tab, it will be drawn as 15125 For example, if a block cursor is over a tab, it will be drawn as
15118 wide as that tab on the display. */); 15126 wide as that tab on the display. */);