Navigation Menu

Skip to content

Commit

Permalink
Fixed bug 4401 - SDL_GetWindowPosition() wrong after SDL_SetWindowPos…
Browse files Browse the repository at this point in the history
…ition() 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.
  • Loading branch information
slouken committed May 19, 2019
1 parent 2ee9b1d commit ee0a482
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/video/SDL_video.c
Expand Up @@ -1895,7 +1895,6 @@ SDL_SetWindowPosition(SDL_Window * window, int x, int y)
if (_this->SetWindowPosition) {
_this->SetWindowPosition(_this, window);
}
SDL_SendWindowEvent(window, SDL_WINDOWEVENT_MOVED, x, y);
}
}

Expand Down

0 comments on commit ee0a482

Please sign in to comment.