(0, 0) of the selected frame's display. */)
(Lisp_Object x, Lisp_Object y)
{
+ UINT trail_num = 0;
+ BOOL ret = false;
+
CHECK_TYPE_RANGED_INTEGER (int, x);
CHECK_TYPE_RANGED_INTEGER (int, y);
block_input ();
+ /* When "mouse trails" are in effect, moving the mouse cursor
+ sometimes leaves behind an annoying "ghost" of the pointer.
+ Avoid that by momentarily switching off mouse trails. */
+ if (os_subtype == OS_NT
+ && w32_major_version + w32_minor_version >= 6)
+ ret = SystemParametersInfo (SPI_GETMOUSETRAILS, 0, &trail_num, 0);
SetCursorPos (XINT (x), XINT (y));
+ if (ret)
+ SystemParametersInfo (SPI_SETMOUSETRAILS, trail_num, NULL, 0);
unblock_input ();
return Qnil;
#include "lisp.h"
#include "blockinput.h"
#include "w32term.h"
+#include "w32common.h" /* for OS version info */
#include <ctype.h>
#include <errno.h>
void
frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
{
+ UINT trail_num = 0;
+ BOOL ret = false;
RECT rect;
POINT pt;
pt.y = rect.top + pix_y;
ClientToScreen (FRAME_W32_WINDOW (f), &pt);
+ /* When "mouse trails" are in effect, moving the mouse cursor
+ sometimes leaves behind an annoying "ghost" of the pointer.
+ Avoid that by momentarily switching off mouse trails. */
+ if (os_subtype == OS_NT
+ && w32_major_version + w32_minor_version >= 6)
+ ret = SystemParametersInfo (SPI_GETMOUSETRAILS, 0, &trail_num, 0);
SetCursorPos (pt.x, pt.y);
+ if (ret)
+ SystemParametersInfo (SPI_SETMOUSETRAILS, trail_num, NULL, 0);
unblock_input ();
}