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 - SDL_SetWindowPosition does not send a SDL_WINDOWEVENT_MOVED
Summary: SDL_SetWindowPosition does not send a SDL_WINDOWEVENT_MOVED
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.0
Hardware: x86 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-12 01:08 UTC by Ioannis Makris
Modified: 2017-09-12 01:08 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.