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 3608

Summary: Broken behavior when combining SDL_WINDOW_FULLSCREEN and SDL_WINDOW_RESIZABLE on X11
Product: SDL Reporter: Shane Calimlim <shane>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: ASSIGNED --- QA Contact: Sam Lantinga <slouken>
Severity: blocker    
Priority: P2 Keywords: target-2.0.6
Version: 2.0.5   
Hardware: x86   
OS: Linux   

Description Shane Calimlim 2017-03-16 18:06:30 UTC
When combining these two flags, full screen windows on X11 function oddly.

Initially I isolated the behavior down to this:

2.0.3
  SDL_CreateWindow 1360 x 768 [flags 0x2027]
  SDL_GL_GetDrawableSize  1360 x 768
  // SDL_CreateWindow will trigger an event or two
  // loop over SDL_Events (but don't actually do anything with them)
  // a resized event occurs with 1360 x 768 as the size
  SDL_GL_GetDrawableSize 1360 x 768
2.0.5
  SDL_CreateWindow 1360 x 768 [flags 0x2027]
  SDL_GL_GetDrawableSize  1360 x 768
  // SDL_CreateWindow will trigger an event or two
  // loop over SDL_Events (but don't actually do anything with them)
  // a resized event occurs with 1295 x 744 as the size
  SDL_GL_GetDrawableSize 1295 x 744

This was suspicious because the reduced size was exactly the resolution minus ubuntu's menus. But the values are incorrect, because the window is still fullscreen.

On Mint this manifests differently, the resized event came in with the correct size, but our rendering was still incorrect (it appeared as if the framebuffer was the wrong size maybe? it lost the height of the mint taskbar, although it lost it on both the top and bottom).

Removing SDL_WINDOW_RESIZABLE fixed our issue, and looking at changes to SDL_x11window.c it appears that X11_XMoveWindow() calls are trying to take into account a new 'border' area, which I assume is the system menu stuff. But it does this regardless of whether the window is fullscreen.

Mixing SDL_WINDOW_FULLSCREEN and SDL_WINDOW_RESIZABLE is weird, but since the behavior is broken when mixed, I'd expect it to be documented, or to assert when attempted. Or SDL should ignore SDL_WINDOW_RESIZABLE when SDL_WINDOW_FULLSCREEN is present.
Comment 1 Sam Lantinga 2017-08-11 18:56:33 UTC
Ryan, this is a regression. Can you look at it?