aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2002-02-16 15:44:03 +0000
committerEli Zaretskii2002-02-16 15:44:03 +0000
commit4a137db11264dae44860e4ea30f179ac4e211c3a (patch)
treed0af9c9e24c696050a378606e64dbfb9a1b03329 /src
parent63a4cd16891dff1777e7bfa074c7d808af023aec (diff)
downloademacs-4a137db11264dae44860e4ea30f179ac4e211c3a.tar.gz
emacs-4a137db11264dae44860e4ea30f179ac4e211c3a.zip
(x_autoselect_window_p): New variable.
(syms_of_msdos): Defvar it. (dos_rawgetc): If x_autoselect_window_p is set, select the window in which the last mouse movement occured, unless it is already selected.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/msdos.c29
2 files changed, 35 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 732e8e2a542..9e061ce4fb1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,11 @@
12002-02-16 Eli Zaretskii <eliz@is.elta.co.il> 12002-02-16 Eli Zaretskii <eliz@is.elta.co.il>
2 2
3 * msdos.c (x_autoselect_window_p): New variable.
4 (syms_of_msdos): Defvar it.
5 (dos_rawgetc): If x_autoselect_window_p is set, select the window
6 in which the last mouse movement occured, unless it is already
7 selected.
8
3 * xdisp.c (automatic_hscroll_margin, Vautomatic_hscroll_step): New 9 * xdisp.c (automatic_hscroll_margin, Vautomatic_hscroll_step): New
4 variables. 10 variables.
5 (syms_of_xdisp): DEVFAR them. 11 (syms_of_xdisp): DEVFAR them.
diff --git a/src/msdos.c b/src/msdos.c
index f466196f9af..f5dff6fb5bc 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -1196,6 +1196,10 @@ static Lisp_Object help_echo_window;
1196static Lisp_Object help_echo_object; 1196static Lisp_Object help_echo_object;
1197static int help_echo_pos; 1197static int help_echo_pos;
1198 1198
1199/* Non-zero means automatically select any window when the mouse
1200 cursor moves into it. */
1201int x_autoselect_window_p;
1202
1199static int mouse_preempted = 0; /* non-zero when XMenu gobbles mouse events */ 1203static int mouse_preempted = 0; /* non-zero when XMenu gobbles mouse events */
1200 1204
1201/* Set the mouse pointer shape according to whether it is in the 1205/* Set the mouse pointer shape according to whether it is in the
@@ -3388,6 +3392,27 @@ dos_rawgetc ()
3388 might need to update mouse highlight. */ 3392 might need to update mouse highlight. */
3389 if (mouse_last_x != mouse_prev_x || mouse_last_y != mouse_prev_y) 3393 if (mouse_last_x != mouse_prev_x || mouse_last_y != mouse_prev_y)
3390 { 3394 {
3395 if (x_autoselect_window_p)
3396 {
3397 int mouse_area;
3398 Lisp_Object mouse_window;
3399
3400 mouse_window = window_from_coordinates (SELECTED_FRAME(),
3401 mouse_last_x,
3402 mouse_last_y,
3403 &mouse_area, 0);
3404 /* A window will be selected only when it is not
3405 selected now and last mouse movement event was not in
3406 it. A minubuffer window will be selected iff it is
3407 active. */
3408 if (!EQ (mouse_window, selected_window)
3409 && (!MINI_WINDOW_P (XWINDOW (mouse_window))
3410 || (EQ (mouse_window, minibuf_window)
3411 && minibuf_level > 0)))
3412 {
3413 Fselect_window (mouse_window);
3414 }
3415 }
3391 previous_help_echo = help_echo; 3416 previous_help_echo = help_echo;
3392 help_echo = help_echo_object = help_echo_window = Qnil; 3417 help_echo = help_echo_object = help_echo_window = Qnil;
3393 help_echo_pos = -1; 3418 help_echo_pos = -1;
@@ -5315,6 +5340,10 @@ syms_of_msdos ()
5315 5340
5316This variable is used only by MSDOS terminals. */); 5341This variable is used only by MSDOS terminals. */);
5317 Vdos_unsupported_char_glyph = '\177'; 5342 Vdos_unsupported_char_glyph = '\177';
5343
5344 DEFVAR_BOOL ("x-autoselect-window", &x_autoselect_window_p,
5345 doc: /* *Non-nil means autoselect window with mouse pointer. */);
5346 x_autoselect_window_p = 0;
5318#endif 5347#endif
5319#ifndef subprocesses 5348#ifndef subprocesses
5320 DEFVAR_BOOL ("delete-exited-processes", &delete_exited_processes, 5349 DEFVAR_BOOL ("delete-exited-processes", &delete_exited_processes,