Mercurial > emacs
comparison src/xterm.c @ 43343:ac7b0c0802cc
(x-autoselect-window): New variable.
(note_mouse_movement): Use it.
author | Pavel Janík <Pavel@Janik.cz> |
---|---|
date | Sat, 16 Feb 2002 10:02:38 +0000 |
parents | 2f479ac769e1 |
children | 493438ba5e2c |
comparison
equal
deleted
inserted
replaced
43342:54b7d7a369a0 | 43343:ac7b0c0802cc |
---|---|
250 | 250 |
251 /* Non-zero means that a HELP_EVENT has been generated since Emacs | 251 /* Non-zero means that a HELP_EVENT has been generated since Emacs |
252 start. */ | 252 start. */ |
253 | 253 |
254 static int any_help_event_p; | 254 static int any_help_event_p; |
255 | |
256 /* Non-zero means autoselect window with the mouse cursor. */ | |
257 | |
258 int x_autoselect_window_p; | |
255 | 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. */ |
259 | 263 |
6641 { | 6645 { |
6642 last_mouse_movement_time = event->time; | 6646 last_mouse_movement_time = event->time; |
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; |
6649 last_mouse_scroll_bar = Qnil; | 6673 last_mouse_scroll_bar = Qnil; |
6650 note_mouse_highlight (frame, -1, -1); | 6674 note_mouse_highlight (frame, -1, -1); |
6662 } | 6686 } |
6663 } | 6687 } |
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; | 6691 int disable_mouse_highlight; |
6668 | 6692 |
6669 | 6693 |
6670 | 6694 |
6671 /************************************************************************ | 6695 /************************************************************************ |
6672 Mouse Face | 6696 Mouse Face |
15039 staticpro (&help_echo_window); | 15063 staticpro (&help_echo_window); |
15040 previous_help_echo = Qnil; | 15064 previous_help_echo = Qnil; |
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. |
15046 For example, if a block cursor is over a tab, it will be drawn as | 15074 For example, if a block cursor is over a tab, it will be drawn as |
15047 wide as that tab on the display. */); | 15075 wide as that tab on the display. */); |
15048 x_stretch_cursor_p = 0; | 15076 x_stretch_cursor_p = 0; |