Skip to content

Fix small windows incorrectly auto-maximized in seamless mode#2

Open
MajidNajafi wants to merge 1 commit into
alparn:mainfrom
MajidNajafi:fix/prevent-auto-maximize-for-small-windows
Open

Fix small windows incorrectly auto-maximized in seamless mode#2
MajidNajafi wants to merge 1 commit into
alparn:mainfrom
MajidNajafi:fix/prevent-auto-maximize-for-small-windows

Conversation

@MajidNajafi
Copy link
Copy Markdown

Bug

In seamless mode, the first window is always auto-maximized to fill the viewport regardless of its size. This is most visible with RDP applications where a small login dialog (username/password prompt) gets stretched to fullscreen instead of appearing at its natural size.

Root Cause

The handleNewWindow auto-maximize heuristic for the first window in seamless mode (!hasDesktop && windowCount === 0) does not consider the window's original dimensions. Any first window that isn't explicitly a popup/dialog/terminal type gets maximized, even if it's a small form or dialog with a NORMAL window type.

Fix

Added a size guard to the auto-maximize condition: the window's server-requested dimensions must be at least 60% of the desktop in both width and height. Small windows now keep their natural size and get centered on screen. Desktop and shadow modes are unaffected (they never hit this code path).

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.

1 participant