Fixed bug 4401 - SDL_GetWindowPosition() wrong after SDL_SetWindowPosition() until window is moved on macOS
authorSam Lantinga <slouken@libsdl.org>
Sun, 19 May 2019 11:52:25 -0700
changeset 12736d3421eeb57a0
parent 12735 5703f3fc6d79
child 12737 b7320ef610b5
Fixed bug 4401 - SDL_GetWindowPosition() wrong after SDL_SetWindowPosition() until window is moved on macOS

Removed incorrect call to SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y);
If the position of the window isn't adjusted in the SetWindowPosition() call, then sending the window event would have no effect because x and y equals the window x and y. If the position of the window is adjusted in the SetWindowPosition() call, then we don't want to clobber it with values that the user passed in.
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_video.c	Sun May 19 11:01:36 2019 -0700
     1.2 +++ b/src/video/SDL_video.c	Sun May 19 11:52:25 2019 -0700
     1.3 @@ -1895,7 +1895,6 @@
     1.4          if (_this->SetWindowPosition) {
     1.5              _this->SetWindowPosition(_this, window);
     1.6          }
     1.7 -        SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y);
     1.8      }
     1.9  }
    1.10