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 3638

Summary: X11: SDL_SetWindowSize always resets the window position to zero
Product: SDL Reporter: Daniel <daniel.plakhotich>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: ASSIGNED --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.4   
Hardware: x86_64   
OS: Linux   

Description Daniel 2017-04-26 17:29:06 UTC
The problem is that when XResizeWindow emits ConfigureNotify, x and y of the XConfigureEvent struct set to zero, because the function doesn't change the coordinates.

This means that XResizeWindow always resets the window position to zero in SDL_x11_events.c by sending SDL_WINDOWEVENT_MOVED.

I do not know whether it's possible to distinguish resizing from moving in X11, but one possible solution is to add X11_XMoveWindow() after X11_XResizeWindow() in X11_SetWindowSize(). It's not perfect since SDL_WINDOWEVENT_MOVED
event will still be generated on resizing, but at least it (and SDL_GetWindowSize()) will have the right position instead of zero.
Comment 1 Sam Lantinga 2017-08-11 18:38:52 UTC
Ryan, can you look at this? Is there a mask of changes that we're not paying attention to?