* src/window.c (last_mouse_window): New global var. All static
instances removed, and all their uses replaced with this global
var. This fixes a very unlikely bug where last_mouse_window was
GC’ed and a new window created in its place. It also fixes several
places that assumed NIL_IS_ZERO without static_asserting it.
(init_window_once): Initialize the new var.
(cherry picked from commit
2e8ef0910412aef8f9f1beba7c942473ad8602bb)
&& (f == XFRAME (selected_frame)
|| !NILP (focus_follows_mouse)))
{
- static Lisp_Object last_mouse_window;
Lisp_Object window
= window_from_coordinates (f, event->xmotion.x,
event->xmotion.y, 0,
if (!NILP (Vmouse_autoselect_window))
{
- static Lisp_Object last_mouse_window;
Lisp_Object window = window_from_coordinates (f, b->x, b->y, 0, 0, 0, 0);
if (WINDOWP (window)
/* Generate SELECT_WINDOW_EVENTs when needed. */
if (!NILP (Vmouse_autoselect_window))
{
- static Lisp_Object last_mouse_window;
-
mouse_window = window_from_coordinates
(SELECTED_FRAME (), mouse_last_x, mouse_last_y, 0, 0, 0, 0);
/* A window will be selected only when it is not
also when the target window is on another frame. */
&& (f == XFRAME (selected_frame) || !NILP (focus_follows_mouse)))
{
- static Lisp_Object last_mouse_window;
Lisp_Object window = window_from_coordinates
(f, event->motion.x, event->motion.y, 0, false, false, false);
struct input_event *emacs_ev)
{
static DWORD button_state = 0;
- static Lisp_Object last_mouse_window;
DWORD but_change, mask, flags = event->dwEventFlags;
int i;
|| (!NILP (focus_follows_mouse)
&& !FRAME_NO_ACCEPT_FOCUS (f))))
{
- static Lisp_Object last_mouse_window;
Lisp_Object window = window_from_coordinates
(f, LOWORD (msg.msg.lParam), HIWORD (msg.msg.lParam), 0, 0, 0, 0);
shown as the selected window when the minibuffer is selected. */
Lisp_Object minibuf_selected_window;
+/* Non-nil means it is the window containing the last mouse movement. */
+Lisp_Object last_mouse_window;
+
/* Incremented for each window created. */
static EMACS_INT sequence_number;
minibuf_selected_window = Qnil;
staticpro (&minibuf_selected_window);
+ last_mouse_window = Qnil;
+ staticpro (&last_mouse_window);
old_selected_window = Qnil;
staticpro (&old_selected_window);
PDUMPER_RESET_LV (selected_window, Qnil);
PDUMPER_RESET_LV (Vwindow_list, Qnil);
PDUMPER_RESET_LV (minibuf_selected_window, Qnil);
+ PDUMPER_RESET_LV (last_mouse_window, Qnil);
/* Hack: if mode_line_in_non_selected_windows is true (which it may
be, if we're restoring from a dump) the guts of
extern Lisp_Object minibuf_selected_window;
+/* Non-nil means it is the window containing the last mouse movement. */
+
+extern Lisp_Object last_mouse_window;
+
extern Lisp_Object make_window (void);
extern Lisp_Object window_from_coordinates (struct frame *, int, int,
enum window_part *, bool, bool, bool);
&& (f == XFRAME (selected_frame)
|| !NILP (focus_follows_mouse)))
{
- static Lisp_Object last_mouse_window;
-
if (xmotion.window != FRAME_X_WINDOW (f))
{
x_translate_coordinates (f, xmotion.x_root, xmotion.y_root,
&& (f == XFRAME (selected_frame)
|| !NILP (focus_follows_mouse)))
{
- static Lisp_Object last_mouse_window;
Lisp_Object window = window_from_coordinates (f, ev.x, ev.y, 0, false, false,
false);