diff options
-rw-r--r-- | src/w32fns.c | 31 | ||||
-rw-r--r-- | src/w32term.c | 8 |
2 files changed, 27 insertions, 12 deletions
diff --git a/src/w32fns.c b/src/w32fns.c index 180d326bc98..836dc10118d 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -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 diff --git a/src/w32term.c b/src/w32term.c index 7c5f2db3a4c..fbd31b15de2 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -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 (); } |