aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32term.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/w32term.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/w32term.c')
-rw-r--r--src/w32term.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/w32term.c b/src/w32term.c
index 0b8bef239f8..60d64f7fd0f 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -23,6 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23#include "lisp.h" 23#include "lisp.h"
24#include "blockinput.h" 24#include "blockinput.h"
25#include "w32term.h" 25#include "w32term.h"
26#include "w32common.h" /* for OS version info */
26 27
27#include <ctype.h> 28#include <ctype.h>
28#include <errno.h> 29#include <errno.h>
@@ -6237,6 +6238,8 @@ x_set_window_size (struct frame *f, bool change_gravity,
6237void 6238void
6238frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y) 6239frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
6239{ 6240{
6241 UINT trail_num = 0;
6242 BOOL ret = false;
6240 RECT rect; 6243 RECT rect;
6241 POINT pt; 6244 POINT pt;
6242 6245
@@ -6247,7 +6250,15 @@ frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
6247 pt.y = rect.top + pix_y; 6250 pt.y = rect.top + pix_y;
6248 ClientToScreen (FRAME_W32_WINDOW (f), &pt); 6251 ClientToScreen (FRAME_W32_WINDOW (f), &pt);
6249 6252
6253 /* When "mouse trails" are in effect, moving the mouse cursor
6254 sometimes leaves behind an annoying "ghost" of the pointer.
6255 Avoid that by momentarily switching off mouse trails. */
6256 if (os_subtype == OS_NT
6257 && w32_major_version + w32_minor_version >= 6)
6258 ret = SystemParametersInfo (SPI_GETMOUSETRAILS, 0, &trail_num, 0);
6250 SetCursorPos (pt.x, pt.y); 6259 SetCursorPos (pt.x, pt.y);
6260 if (ret)
6261 SystemParametersInfo (SPI_SETMOUSETRAILS, trail_num, NULL, 0);
6251 6262
6252 unblock_input (); 6263 unblock_input ();
6253} 6264}