aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorEli Zaretskii2015-12-27 20:52:21 +0200
committerEli Zaretskii2015-12-27 20:52:21 +0200
commit3ad99c4674e670b73e7dcd8de3fa00b6dec4448f (patch)
treef3a40bad541f0e97499fee390040089c209bebcc /src/w32fns.c
parentf9d87dd8791d4e77929f21e4f73d92ef966722cc (diff)
downloademacs-3ad99c4674e670b73e7dcd8de3fa00b6dec4448f.tar.gz
emacs-3ad99c4674e670b73e7dcd8de3fa00b6dec4448f.zip
Avoid leaving "ghost" of mouse pointer on MS-Windows
* src/w32term.c (frame_set_mouse_pixel_position): * src/w32fns.c (Fw32_mouse_absolute_pixel_position): Momentarily disable "mouse trails" when moving the mouse pointer. (Bug#22247) * src/w32term.c (frame_set_mouse_pixel_position): Include w32common.h.
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index 4be322182ce..c1d9bff98ab 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -8093,11 +8093,22 @@ The coordinates X and Y are interpreted in pixels relative to a position
8093(0, 0) of the selected frame's display. */) 8093(0, 0) of the selected frame's display. */)
8094 (Lisp_Object x, Lisp_Object y) 8094 (Lisp_Object x, Lisp_Object y)
8095{ 8095{
8096 UINT trail_num = 0;
8097 BOOL ret = false;
8098
8096 CHECK_TYPE_RANGED_INTEGER (int, x); 8099 CHECK_TYPE_RANGED_INTEGER (int, x);
8097 CHECK_TYPE_RANGED_INTEGER (int, y); 8100 CHECK_TYPE_RANGED_INTEGER (int, y);
8098 8101
8099 block_input (); 8102 block_input ();
8103 /* When "mouse trails" are in effect, moving the mouse cursor
8104 sometimes leaves behind an annoying "ghost" of the pointer.
8105 Avoid that by momentarily switching off mouse trails. */
8106 if (os_subtype == OS_NT
8107 && w32_major_version + w32_minor_version >= 6)
8108 ret = SystemParametersInfo (SPI_GETMOUSETRAILS, 0, &trail_num, 0);
8100 SetCursorPos (XINT (x), XINT (y)); 8109 SetCursorPos (XINT (x), XINT (y));
8110 if (ret)
8111 SystemParametersInfo (SPI_SETMOUSETRAILS, trail_num, NULL, 0);
8101 unblock_input (); 8112 unblock_input ();
8102 8113
8103 return Qnil; 8114 return Qnil;