aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorPavel Janík2002-02-16 10:02:38 +0000
committerPavel Janík2002-02-16 10:02:38 +0000
commit503e457ee66a2d70ea4c3dfb5b60869894c1ffe1 (patch)
tree6f362cfa7ed5c3d1fe8e1de68a2eb4daad71ad21 /src/xterm.c
parent5d2200aa40df1fde2907217493f51a23ed2649c9 (diff)
downloademacs-503e457ee66a2d70ea4c3dfb5b60869894c1ffe1.tar.gz
emacs-503e457ee66a2d70ea4c3dfb5b60869894c1ffe1.zip
(x-autoselect-window): New variable.
(note_mouse_movement): Use it.
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/xterm.c b/src/xterm.c
index e6382539c3a..4de1f5fc721 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -253,6 +253,10 @@ static Lisp_Object previous_help_echo;
253 253
254static int any_help_event_p; 254static int any_help_event_p;
255 255
256/* Non-zero means autoselect window with the mouse cursor. */
257
258int x_autoselect_window_p;
259
256/* Non-zero means draw block and hollow cursor as wide as the glyph 260/* Non-zero means draw block and hollow cursor as wide as the glyph
257 under it. For example, if a block cursor is over a tab, it will be 261 under it. For example, if a block cursor is over a tab, it will be
258 drawn as wide as that tab on the display. */ 262 drawn as wide as that tab on the display. */
@@ -6643,6 +6647,26 @@ note_mouse_movement (frame, event)
6643 last_mouse_motion_event = *event; 6647 last_mouse_motion_event = *event;
6644 XSETFRAME (last_mouse_motion_frame, frame); 6648 XSETFRAME (last_mouse_motion_frame, frame);
6645 6649
6650 if (x_autoselect_window_p)
6651 {
6652 int area;
6653 Lisp_Object window;
6654 static Lisp_Object last_window;
6655
6656 window = window_from_coordinates (frame, XINT (event->x), XINT (event->y), &area, 0);
6657
6658 /* Window will be selected only when it is not selected now and
6659 last mouse movement event was not in it. Minubuffer window
6660 will be selected iff it is active. */
6661 if (!EQ (window, last_window)
6662 && !EQ (window, selected_window)
6663 && (!MINI_WINDOW_P (XWINDOW (window))
6664 || (EQ (window, minibuf_window) && minibuf_level > 0)))
6665 Fselect_window (window);
6666
6667 last_window=window;
6668 }
6669
6646 if (event->window != FRAME_X_WINDOW (frame)) 6670 if (event->window != FRAME_X_WINDOW (frame))
6647 { 6671 {
6648 frame->mouse_moved = 1; 6672 frame->mouse_moved = 1;
@@ -6664,7 +6688,7 @@ note_mouse_movement (frame, event)
6664 6688
6665/* This is used for debugging, to turn off note_mouse_highlight. */ 6689/* This is used for debugging, to turn off note_mouse_highlight. */
6666 6690
6667 int disable_mouse_highlight; 6691int disable_mouse_highlight;
6668 6692
6669 6693
6670 6694
@@ -15041,6 +15065,10 @@ syms_of_xterm ()
15041 staticpro (&previous_help_echo); 15065 staticpro (&previous_help_echo);
15042 help_echo_pos = -1; 15066 help_echo_pos = -1;
15043 15067
15068 DEFVAR_BOOL ("x-autoselect-window", &x_autoselect_window_p,
15069 doc: /* *Non-nil means autoselect window with mouse pointer. */);
15070 x_autoselect_window_p = 0;
15071
15044 DEFVAR_BOOL ("x-stretch-cursor", &x_stretch_cursor_p, 15072 DEFVAR_BOOL ("x-stretch-cursor", &x_stretch_cursor_p,
15045 doc: /* *Non-nil means draw block cursor as wide as the glyph under it. 15073 doc: /* *Non-nil means draw block cursor as wide as the glyph under it.
15046For example, if a block cursor is over a tab, it will be drawn as 15074For example, if a block cursor is over a tab, it will be drawn as