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 - X11: SDL_SetWindowSize always resets the window position to zero
Summary: X11: SDL_SetWindowSize always resets the window position to zero
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.4
Hardware: x86_64 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-26 17:29 UTC by Daniel
Modified: 2017-08-11 18:38 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 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?