#include <dlgs.h>
#include <imm.h>
+#include <windowsx.h>
#include "font.h"
#include "w32font.h"
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
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 ();
}