diff options
| author | Dmitry Antipov | 2013-09-02 10:45:04 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-09-02 10:45:04 +0400 |
| commit | 1fccc5306363a88fc3f663e2a149d0251612d3e9 (patch) | |
| tree | 598c320c94cf1fb004a8b09aad138d37115ec109 /src/xterm.c | |
| parent | b7da754d21b4515b3e75b9f28608d99185ea0ec3 (diff) | |
| download | emacs-1fccc5306363a88fc3f663e2a149d0251612d3e9.tar.gz emacs-1fccc5306363a88fc3f663e2a149d0251612d3e9.zip | |
* msdos.c (last_mouse_window): Move to...
(dos_rawgetc): ...this function and adjust comment.
* nsterm.m (last_window): Rename to last_mouse_window, move to...
(mouseMoved): ...this function and adjust comment.
* w32term.c (last_window): Likewise with...
(w32_read_socket): ...this function.
* xterm.c (last_window): Likewise with...
(handle_one_xevent): ...this function.
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/src/xterm.c b/src/xterm.c index c4e3aeaa615..4355e9d6b83 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -140,16 +140,11 @@ int use_xim = 1; | |||
| 140 | int use_xim = 0; /* configure --without-xim */ | 140 | int use_xim = 0; /* configure --without-xim */ |
| 141 | #endif | 141 | #endif |
| 142 | 142 | ||
| 143 | |||
| 144 | |||
| 145 | /* Non-zero means that a HELP_EVENT has been generated since Emacs | 143 | /* Non-zero means that a HELP_EVENT has been generated since Emacs |
| 146 | start. */ | 144 | start. */ |
| 147 | 145 | ||
| 148 | static bool any_help_event_p; | 146 | static bool any_help_event_p; |
| 149 | 147 | ||
| 150 | /* Last window where we saw the mouse. Used by mouse-autoselect-window. */ | ||
| 151 | static Lisp_Object last_window; | ||
| 152 | |||
| 153 | /* This is a chain of structures for all the X displays currently in | 148 | /* This is a chain of structures for all the X displays currently in |
| 154 | use. */ | 149 | use. */ |
| 155 | 150 | ||
| @@ -6656,18 +6651,16 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6656 | /* Generate SELECT_WINDOW_EVENTs when needed. | 6651 | /* Generate SELECT_WINDOW_EVENTs when needed. |
| 6657 | Don't let popup menus influence things (bug#1261). */ | 6652 | Don't let popup menus influence things (bug#1261). */ |
| 6658 | if (!NILP (Vmouse_autoselect_window) && !popup_activated ()) | 6653 | if (!NILP (Vmouse_autoselect_window) && !popup_activated ()) |
| 6659 | { | 6654 | { |
| 6660 | Lisp_Object window; | 6655 | static Lisp_Object last_mouse_window; |
| 6661 | 6656 | Lisp_Object window = window_from_coordinates | |
| 6662 | window = window_from_coordinates (f, | 6657 | (f, event.xmotion.x, event.xmotion.y, 0, 0); |
| 6663 | event.xmotion.x, event.xmotion.y, | 6658 | |
| 6664 | 0, 0); | 6659 | /* Window will be selected only when it is not selected now and |
| 6665 | 6660 | last mouse movement event was not in it. Minibuffer window | |
| 6666 | /* Window will be selected only when it is not selected now and | 6661 | will be selected only when it is active. */ |
| 6667 | last mouse movement event was not in it. Minibuffer window | 6662 | if (WINDOWP (window) |
| 6668 | will be selected only when it is active. */ | 6663 | && !EQ (window, last_mouse_window) |
| 6669 | if (WINDOWP (window) | ||
| 6670 | && !EQ (window, last_window) | ||
| 6671 | && !EQ (window, selected_window) | 6664 | && !EQ (window, selected_window) |
| 6672 | /* For click-to-focus window managers | 6665 | /* For click-to-focus window managers |
| 6673 | create event iff we don't leave the | 6666 | create event iff we don't leave the |
| @@ -6675,13 +6668,13 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6675 | && (focus_follows_mouse | 6668 | && (focus_follows_mouse |
| 6676 | || (EQ (XWINDOW (window)->frame, | 6669 | || (EQ (XWINDOW (window)->frame, |
| 6677 | XWINDOW (selected_window)->frame)))) | 6670 | XWINDOW (selected_window)->frame)))) |
| 6678 | { | 6671 | { |
| 6679 | inev.ie.kind = SELECT_WINDOW_EVENT; | 6672 | inev.ie.kind = SELECT_WINDOW_EVENT; |
| 6680 | inev.ie.frame_or_window = window; | 6673 | inev.ie.frame_or_window = window; |
| 6681 | } | 6674 | } |
| 6682 | 6675 | /* Remember the last window where we saw the mouse. */ | |
| 6683 | last_window=window; | 6676 | last_mouse_window = window; |
| 6684 | } | 6677 | } |
| 6685 | if (!note_mouse_movement (f, &event.xmotion)) | 6678 | if (!note_mouse_movement (f, &event.xmotion)) |
| 6686 | help_echo_string = previous_help_echo_string; | 6679 | help_echo_string = previous_help_echo_string; |
| 6687 | } | 6680 | } |