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 5530 - Maximised window with SDL_BORDERLESS_WINDOWED_STYLE hint has edges clipped and overlaps 2nd monitor
Summary: Maximised window with SDL_BORDERLESS_WINDOWED_STYLE hint has edges clipped an...
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.14
Hardware: x86_64 Windows 10
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-04 10:10 UTC by Jon
Modified: 2021-02-04 10:10 UTC (History)
0 users

See Also:


Attachments
Screenshot of clipped edge and overlap onto second monitor when maximised (34.09 KB, image/png)
2021-02-04 10:10 UTC, Jon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jon 2021-02-04 10:10:20 UTC
Created attachment 4760 [details]
Screenshot of clipped edge and overlap onto second monitor when maximised

Maximising a window created with the SDL_BORDERLESS_WINDOWED_STYLE and SDL_BORDERLESS_RESIZABLE_STYLE hints results in the edges of the drawable region being clipped and some visible overlap on a second monitor.


Steps to Reproduce

1. Set SDL_BORDERLESS_WINDOWED_STYLE and SDL_BORDERLESS_RESIZABLE_STYLE hints
2. Create a window with flags SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS | SDL_WINDOW_RESIZABLE
3. Maximise window through any means (drag-snapping to the top of the screen, double-clicking custom titlebar area, win-up)


Actual Results

The window becomes too large for the monitor it is displayed on with roughly 8px around all edges of the window being cut off.

Additionally, with a dual monitor setup, maximising the window on the rightmost monitor results in a black strip down the side of the other monitor. The overlap appears to be the same width as the strip that is cut off from the edge of the window, and has the same height as the height of the window prior to maximising.


Expected Results

No overlap on the second monitor, and for the client area of the maximised window to be fully within the bounds of the monitor and taskbar with no part of the gl context clipped.


Build Date & Hardware

Tested with SDL 2.0.14 (stable)
Windows 10 Version 10.0.18363 Build 18363


Additional Information

- The monitors are both 1080p, landscape with display scaling set to 100% 
- The rendered content is using a glViewport of (0, 0, win_w, win_h) where win_w and win_h are the values returned by SDL_GetWindowSize
- The width and height returned by SDL_GetWindowSize when maximised is 1936x1056, which is 16px wider than the resolution of the display (and presumably taller than the space between the top of the display and the taskbar)
- I have only tested this on a dual-monitor setup so can't currently be sure if the clipping issue is present for single-monitor setups

I've also attached a screenshot showing the issue.