Commit f1427563 authored by Eli Zaretskii's avatar Eli Zaretskii Committed by Martin Rudalics

Fix invisible mouse pointers on Windows.

* src/w32fns.c: Include windowsx.h.
(w32_wnd_proc): If the mouse moved and the mouse pointer is
invisible, make it visible again even when the main (Lisp)
thread is busy.
* src/w32term.c (w32_toggle_invisible_pointer): Rather then
garbaging the frame have the input thread call SetCursor.
parent 605765af
......@@ -73,6 +73,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <dlgs.h>
#include <imm.h>
#include <windowsx.h>
#include "font.h"
#include "w32font.h"
......@@ -3493,13 +3494,31 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return (msg == WM_XBUTTONDOWN || msg == WM_XBUTTONUP);
case WM_MOUSEMOVE:
/* Ignore mouse movements as long as the menu is active. These
movements are processed by the window manager anyway, and
it's wrong to handle them as if they happened on the
underlying frame. */
f = x_window_to_frame (dpyinfo, hwnd);
if (f && f->output_data.w32->menubar_active)
return 0;
if (f)
{
/* Ignore mouse movements as long as the menu is active.
These movements are processed by the window manager
anyway, and it's wrong to handle them as if they happened
on the underlying frame. */
if (f->output_data.w32->menubar_active)
return 0;
/* If the mouse moved, and the mouse pointer is invisible,
make it visible again. We do this here so as to be able
to show the mouse pointer even when the main
(a.k.a. "Lisp") thread is busy doing something. */
static int last_x, last_y;
int x = GET_X_LPARAM (lParam);
int y = GET_Y_LPARAM (lParam);
if (f->pointer_invisible
&& (x != last_x || y != last_y))
f->pointer_invisible = false;
last_x = x;
last_y = y;
}
/* If the mouse has just moved into the frame, start tracking
it, so we will be notified when it leaves the frame. Mouse
......
......@@ -6613,14 +6613,10 @@ w32_toggle_invisible_pointer (struct frame *f, bool invisible)
if (f->pointer_invisible != invisible)
{
f->pointer_invisible = invisible;
SET_FRAME_GARBAGED (f);
w32_define_cursor (FRAME_W32_WINDOW (f),
f->output_data.w32->current_cursor);
}
if (invisible)
SetCursor (NULL);
else
SetCursor (f->output_data.w32->current_cursor);
unblock_input ();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment