* 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.
This commit is contained in:
parent
b7da754d21
commit
1fccc53063
5 changed files with 46 additions and 51 deletions
|
@ -1,3 +1,14 @@
|
|||
2013-09-02 Dmitry Antipov <dmantipov@yandex.ru>
|
||||
|
||||
* 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.
|
||||
|
||||
2013-09-02 Dmitry Antipov <dmantipov@yandex.ru>
|
||||
|
||||
* window.h (Vmouse_window, Vmouse_event): Remove the leftovers.
|
||||
|
|
14
src/msdos.c
14
src/msdos.c
|
@ -946,9 +946,6 @@ IT_write_glyphs (struct frame *f, struct glyph *str, int str_len)
|
|||
Mouse Highlight (and friends..)
|
||||
************************************************************************/
|
||||
|
||||
/* Last window where we saw the mouse. Used by mouse-autoselect-window. */
|
||||
static Lisp_Object last_mouse_window;
|
||||
|
||||
static int mouse_preempted = 0; /* non-zero when XMenu gobbles mouse events */
|
||||
|
||||
int
|
||||
|
@ -2668,10 +2665,10 @@ dos_rawgetc (void)
|
|||
/* Generate SELECT_WINDOW_EVENTs when needed. */
|
||||
if (!NILP (Vmouse_autoselect_window))
|
||||
{
|
||||
mouse_window = window_from_coordinates (SELECTED_FRAME (),
|
||||
mouse_last_x,
|
||||
mouse_last_y,
|
||||
0, 0);
|
||||
static Lisp_Object last_mouse_window;
|
||||
|
||||
mouse_window = window_from_coordinates
|
||||
(SELECTED_FRAME (), mouse_last_x, mouse_last_y, 0, 0);
|
||||
/* A window will be selected only when it is not
|
||||
selected now, and the last mouse movement event was
|
||||
not in it. A minibuffer window will be selected iff
|
||||
|
@ -2686,10 +2683,9 @@ dos_rawgetc (void)
|
|||
event.timestamp = event_timestamp ();
|
||||
kbd_buffer_store_event (&event);
|
||||
}
|
||||
/* Remember the last window where we saw the mouse. */
|
||||
last_mouse_window = mouse_window;
|
||||
}
|
||||
else
|
||||
last_mouse_window = Qnil;
|
||||
|
||||
previous_help_echo_string = help_echo_string;
|
||||
help_echo_string = help_echo_object = help_echo_window = Qnil;
|
||||
|
|
16
src/nsterm.m
16
src/nsterm.m
|
@ -184,9 +184,6 @@ Updated by Christian Limpach (chris@nice.ch)
|
|||
Lisp_Object ns_display_name_list;
|
||||
long context_menu_value = 0;
|
||||
|
||||
/* Last window where we saw the mouse. Used by mouse-autoselect-window. */
|
||||
static Lisp_Object last_window;
|
||||
|
||||
/* display update */
|
||||
NSPoint last_mouse_motion_position;
|
||||
static NSRect last_mouse_glyph;
|
||||
|
@ -5458,11 +5455,13 @@ - (void)mouseMoved: (NSEvent *)e
|
|||
if (!NILP (Vmouse_autoselect_window))
|
||||
{
|
||||
NSTRACE (mouse_autoselect_window);
|
||||
Lisp_Object window;
|
||||
window = window_from_coordinates(emacsframe, last_mouse_motion_position.x,
|
||||
last_mouse_motion_position.y, 0, 0);
|
||||
static Lisp_Object last_mouse_window;
|
||||
Lisp_Object window = window_from_coordinates
|
||||
(emacsframe, last_mouse_motion_position.x,
|
||||
last_mouse_motion_position.y, 0, 0);
|
||||
|
||||
if (WINDOWP (window)
|
||||
&& !EQ (window, last_window)
|
||||
&& !EQ (window, last_mouse_window)
|
||||
&& !EQ (window, selected_window)
|
||||
&& (focus_follows_mouse
|
||||
|| (EQ (XWINDOW (window)->frame,
|
||||
|
@ -5473,7 +5472,8 @@ - (void)mouseMoved: (NSEvent *)e
|
|||
emacs_event->frame_or_window = window;
|
||||
EV_TRAILER2 (e);
|
||||
}
|
||||
last_window = window;
|
||||
/* Remember the last window where we saw the mouse. */
|
||||
last_mouse_window = window;
|
||||
}
|
||||
|
||||
if (!note_mouse_movement (emacsframe, last_mouse_motion_position.x,
|
||||
|
|
|
@ -84,9 +84,6 @@ static int last_mousemove_y = 0;
|
|||
|
||||
static int any_help_event_p;
|
||||
|
||||
/* Last window where we saw the mouse. Used by mouse-autoselect-window. */
|
||||
static Lisp_Object last_window;
|
||||
|
||||
extern unsigned int msh_mousewheel;
|
||||
|
||||
extern void free_frame_menubar (struct frame *);
|
||||
|
@ -4503,18 +4500,16 @@ w32_read_socket (struct terminal *terminal,
|
|||
/* Generate SELECT_WINDOW_EVENTs when needed. */
|
||||
if (!NILP (Vmouse_autoselect_window))
|
||||
{
|
||||
Lisp_Object window;
|
||||
int x = LOWORD (msg.msg.lParam);
|
||||
int y = HIWORD (msg.msg.lParam);
|
||||
|
||||
window = window_from_coordinates (f, x, y, 0, 0);
|
||||
static Lisp_Object last_mouse_window;
|
||||
Lisp_Object window = window_from_coordinates
|
||||
(f, LOWORD (msg.msg.lParam), HIWORD (msg.msg.lParam), 0, 0);
|
||||
|
||||
/* Window will be selected only when it is not
|
||||
selected now and last mouse movement event was
|
||||
not in it. Minibuffer window will be selected
|
||||
only when it is active. */
|
||||
if (WINDOWP (window)
|
||||
&& !EQ (window, last_window)
|
||||
&& !EQ (window, last_mouse_window)
|
||||
&& !EQ (window, selected_window)
|
||||
/* For click-to-focus window managers
|
||||
create event iff we don't leave the
|
||||
|
@ -4526,8 +4521,8 @@ w32_read_socket (struct terminal *terminal,
|
|||
inev.kind = SELECT_WINDOW_EVENT;
|
||||
inev.frame_or_window = window;
|
||||
}
|
||||
|
||||
last_window = window;
|
||||
/* Remember the last window where we saw the mouse. */
|
||||
last_mouse_window = window;
|
||||
}
|
||||
if (!note_mouse_movement (f, &msg.msg))
|
||||
help_echo_string = previous_help_echo_string;
|
||||
|
|
39
src/xterm.c
39
src/xterm.c
|
@ -140,16 +140,11 @@ int use_xim = 1;
|
|||
int use_xim = 0; /* configure --without-xim */
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Non-zero means that a HELP_EVENT has been generated since Emacs
|
||||
start. */
|
||||
|
||||
static bool any_help_event_p;
|
||||
|
||||
/* Last window where we saw the mouse. Used by mouse-autoselect-window. */
|
||||
static Lisp_Object last_window;
|
||||
|
||||
/* This is a chain of structures for all the X displays currently in
|
||||
use. */
|
||||
|
||||
|
@ -6656,18 +6651,16 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
|
|||
/* Generate SELECT_WINDOW_EVENTs when needed.
|
||||
Don't let popup menus influence things (bug#1261). */
|
||||
if (!NILP (Vmouse_autoselect_window) && !popup_activated ())
|
||||
{
|
||||
Lisp_Object window;
|
||||
{
|
||||
static Lisp_Object last_mouse_window;
|
||||
Lisp_Object window = window_from_coordinates
|
||||
(f, event.xmotion.x, event.xmotion.y, 0, 0);
|
||||
|
||||
window = window_from_coordinates (f,
|
||||
event.xmotion.x, event.xmotion.y,
|
||||
0, 0);
|
||||
|
||||
/* Window will be selected only when it is not selected now and
|
||||
last mouse movement event was not in it. Minibuffer window
|
||||
will be selected only when it is active. */
|
||||
if (WINDOWP (window)
|
||||
&& !EQ (window, last_window)
|
||||
/* Window will be selected only when it is not selected now and
|
||||
last mouse movement event was not in it. Minibuffer window
|
||||
will be selected only when it is active. */
|
||||
if (WINDOWP (window)
|
||||
&& !EQ (window, last_mouse_window)
|
||||
&& !EQ (window, selected_window)
|
||||
/* For click-to-focus window managers
|
||||
create event iff we don't leave the
|
||||
|
@ -6675,13 +6668,13 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr,
|
|||
&& (focus_follows_mouse
|
||||
|| (EQ (XWINDOW (window)->frame,
|
||||
XWINDOW (selected_window)->frame))))
|
||||
{
|
||||
inev.ie.kind = SELECT_WINDOW_EVENT;
|
||||
inev.ie.frame_or_window = window;
|
||||
}
|
||||
|
||||
last_window=window;
|
||||
}
|
||||
{
|
||||
inev.ie.kind = SELECT_WINDOW_EVENT;
|
||||
inev.ie.frame_or_window = window;
|
||||
}
|
||||
/* Remember the last window where we saw the mouse. */
|
||||
last_mouse_window = window;
|
||||
}
|
||||
if (!note_mouse_movement (f, &event.xmotion))
|
||||
help_echo_string = previous_help_echo_string;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue