We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3822

Summary: SDL_SetWindowPosition does not send a SDL_WINDOWEVENT_MOVED
Product: SDL Reporter: Ioannis Makris <imak>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86   
OS: Windows 7   

Description Ioannis Makris 2017-09-12 01:08:39 UTC
I think that SDL_SetWindowPosition, on Windows, would never send a SDL_WINDOWEVENT_MOVED

in SDL_video.c (https://hg.libsdl.org/SDL/file/d167d43d74f2/src/video/SDL_video.c) we have the following:

  1813         if (!SDL_WINDOWPOS_ISUNDEFINED(x)) {
  1814             window->x = x;
  1815         }
  1816         if (!SDL_WINDOWPOS_ISUNDEFINED(y)) {
  1817             window->y = y;
  1818         }
  1819 
  1820         if (_this->SetWindowPosition) {
  1821             _this->SetWindowPosition(_this, window);
  1822         }
  1823         SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y);

then in SDL_windowevents.c (https://hg.libsdl.org/SDL/file/d167d43d74f2/src/events/SDL_windowevents.c):
  
https://hg.libsdl.org/SDL/file/d167d43d74f2/src/events/SDL_windowevents.c

   122         if (data1 == window->x && data2 == window->y) {
   123             return 0;
   124         }
   
but data1 and data2 is x and y. It will always return 0 and skip sending the message further.