Skip to content

Update overlay bounds before entering fullscreen to always enter fullscreen on correct monitor#45

Merged
SnosMe merged 4 commits intoSnosMe:masterfrom
Kami-Guru:fix-overlay-fullscren-on-wrong-monitor
Aug 25, 2025
Merged

Update overlay bounds before entering fullscreen to always enter fullscreen on correct monitor#45
SnosMe merged 4 commits intoSnosMe:masterfrom
Kami-Guru:fix-overlay-fullscren-on-wrong-monitor

Conversation

@Kami-Guru
Copy link
Contributor

@Kami-Guru Kami-Guru commented Aug 23, 2025

Fixes #44, also just realised this may fix #16, not sure if this is the exact scenario mentioned in that issue though.

When target is in fullscreen (or windowed fullscreen on linux) the attach event will make overlay fullscreen then update the bounds. If the overlay starts on second monitor this will cause overlay to fullscreen on second monitor, and the bound adjustment afterwards does nothing. This probably only happens when second monitor is on the left, as I assume electron window defaults to x: 0, y: 0, which would be on the leftmost monitor.

First, in attach event handler, update this.targetBounds before handleFullscreen, then in handleFullscreen update bounds before entering fullscreen to guarantee overlay is on the same monitor as target.

@SnosMe SnosMe merged commit 37f4c25 into SnosMe:master Aug 25, 2025
@SnosMe
Copy link
Owner

SnosMe commented Aug 25, 2025

published

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.

Attach/Moveresize Issues on Linux Overlay may appear on the wrong screen

2 participants