Skip to content

Fix window visibility/positioning on Windows; resolves #546#561

Merged
bhaller merged 1 commit into
MesserLab:masterfrom
chris-a-talbot:fix-windows-position
Sep 10, 2025
Merged

Fix window visibility/positioning on Windows; resolves #546#561
bhaller merged 1 commit into
MesserLab:masterfrom
chris-a-talbot:fix-windows-position

Conversation

@chris-a-talbot
Copy link
Copy Markdown
Contributor

@chris-a-talbot chris-a-talbot commented Sep 10, 2025

SLiMgui, upon startup, attempts to open in the same position it was last in. However, in the case of multiple screens, this may end up being off-screen (if an external monitor was removed, for example). This commit ensures that, on startup, the main window first attempts to re-open at its last location; however, if that location is off-screen, it adjusts itself to somewhere visible. It also automatically updates its position in the event the available monitors are modified (removed, adjusted, etc.). In the event an app is open in fullscreen in the space needed to open, SLiMgui will attempt to overlay that fullscreen app. If this is not possible, it will trigger an alert on the taskbar/dock, notifying the user that the app has been opened in the background.

From what I could tell, the key problem was that QtSLiMMakeWindowVisibleAndExposed was not being called in main.cpp on startup. I think that one line may have been a complete fix. The remainder of the work is focused on improving the behavior of the windows in the context of display changes (or fullscreen apps), hopefully further avoiding visibility issues.

Resolves issue #546

SLiMgui, upon startup, attempts to open in the same position it was last in. However, in the case of multiple screens, this may end up being off-screen (if an external monitor was removed, for example). This commit ensures that, on startup, the main window first attempts to re-open at its last location; however, if that location is off-screen, it adjusts itself to somewhere visible. It also automatically updates its position in the event the available monitors are modified (removed, adjusted, etc.). In the event an app is open in fullscreen in the space needed to open, SLiMgui will attempt to overlay that fullscreen app. If this is not possible, it will trigger an alert on the taskbar/dock, notifying the user that the app has been opened in the background.
@bhaller
Copy link
Copy Markdown
Contributor

bhaller commented Sep 10, 2025

LGTM, thanks! I'll do some testing of it once it's merged, on macOS.

@bhaller bhaller merged commit 60b0600 into MesserLab:master Sep 10, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants