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 5277 - [X11] SDL_SetWindowPosition can not move window outside of desktop bounds
Summary: [X11] SDL_SetWindowPosition can not move window outside of desktop bounds
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.13
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-31 12:09 UTC by Rokas Kupstys
Modified: 2020-08-31 12:09 UTC (History)
0 users

See Also:


Attachments
Screen configuration (20.04 KB, image/png)
2020-08-31 12:09 UTC, Rokas Kupstys
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rokas Kupstys 2020-08-31 12:09:01 UTC
Created attachment 4456 [details]
Screen configuration

We are using SDL windows without decorations + SDL_SetWindowPosition() to move them. On X11 such windows can not move outside of desktop bounds. This behavior does not manifest on other platforms. This behavior is a consequence of xattr.override_redirect being set to false for normal windows. This flag is set to true only for tooltips and popups. Maybe it would also make sense to set it for borderless windows? A quick test overhere seems to work, though i do not know all implications of toggling this flag.

Steps to reproduce:
1. git clone --single-branch --branch docking https://github.com/ocornut/imgui.git
2. cd imgui/examples/example_sdl_opengl3
3. make
4. ./example_sdl_opengl3
5. Drag either of Dear ImGui windows ("Hello, world!" or "Dear ImGui Demo") outside of main viewport and try to move window outside of desktop bounds.

Result: Window edge will get stuck at desktop edge. Note that this also confuses Dear ImGui and mouse inputs get registered in wrong locations, this is nothing to be concerned about.
In case of multi-monitor setups please use screen at the edge of global X11 display canvas (made up terminology, hope it makes sense). I have two monitors and i can drag these windows to stick outside of smaller screen. For clarity i attached a screenshot with market green area where window _can_ stick out.

Expected result: Dear ImGui window should be able to stick outside of desktop bounds, just like we can drag any other window by it's decorations to stick out of bounds.