Skip to content

Keep a maximized window maximized when its own app opens a menu - #16544

Closed
rndaom wants to merge 2 commits into
omacom:quattrofrom
rndaom:fix-maximized-app-popups
Closed

rndaom wants to merge 2 commits into
omacom:quattrofrom
rndaom:fix-maximized-app-popups

Conversation

@rndaom

@rndaom rndaom commented Oct 25, 2026 •

Copy link
Copy Markdown

On a floating workspace, Steam can't stay maximized. Maximize it with the titlebar button, then hover or click Store, Library or any other dropdown: Steam drops back to its own size, and has to be maximized again after every menu.

Steam runs under XWayland, where each dropdown opens as a short-lived window of its own (an override-redirect window, empty title, same process as Steam). The mode's window.open handler brings a maximized window back to its own size whenever another window opens on its floating workspace, so every menu counted as a new window and unmaximized Steam.

  • A window the maximized app opens itself leaves it maximized. unmaximize_others now skips a maximized window from the same process as the one opening. That covers XWayland dropdown menus, and also an app's dialogs, which belong over the window they came from rather than shrinking it.
  • A window from another app still brings a maximized one back to its own size, so the two can share the workspace, but only when the floating mode's open rule places it. Since 4d8a4e2, a window that floats on its own account (a modal dialog, a portal's file picker, or an app with a float rule of its own) opens over the maximized window and leaves it maximized.
  • A window with no pid is treated as another app, so nothing changes where Hyprland can't tell.

Trade-off: the check is by process, not by window kind. Hyprland 0.56 doesn't expose whether a window is override-redirect (or transient for another) to Lua, so a precise "is this a popup" test isn't available. The side effect is that apps that run every window in one process, such as Chrome, or a terminal in single-instance mode, no longer unmaximize themselves when they open a second window: the new window opens over the maximized one instead, as it would on Windows. A narrower test (XWayland, empty title, same process) would keep that case as it was, but would still let an app's dialogs unmaximize it and leans on the title as a signal, so I went with the simpler rule. Happy to narrow it if you'd rather keep the old behavior for same-app windows.

Verified: reproduced on a live session and recorded the events: each Steam dropdown is an openwindow from Steam's own pid, followed by unmaximize_others taking the maximize away. With this change applied to the live config, Steam stays maximized through the Store and Library dropdowns. test/shell.d/hyprland-floating-workspaces-test.sh passes; its new case fails without the change.

@greptile-apps

greptile-apps Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable new issue was found.

Summary

Keeps maximized windows at their size when the same process opens another window. Also leaves them maximized when dialogs or apps with their own float rules open.

  • An app's own windows leave it maximized.

Reviews (2) · Last reviewed commit: "Keep a maximized window maximized when a..." · Reviewed by Greptile

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this, @rndaom. I've only read it so far: nothing has run on a worker yet, and no labels have been added, because the two models classifying it disagree.

Claude Opus 5.5 reads it as a bug fix: Steam loses its maximize every time it opens one of its own dropdowns. Codex at medium effort reads it as an enhancement, a deliberate change to how maximized windows behave on a floating workspace. The diff gives that reading some weight: a second window from the same process (a second Chrome window, for example) no longer unmaximizes the first, which the description names as a trade-off. Since 4d8a4e2, only a window the floating mode's open rule claims unmaximizes anything. Until the maintainer settles which it is, I'm not verifying it or marking it ready.

One thing for you, whichever way that goes: the description doesn't cover 4d8a4e2. It still says "A window from another app still brings a maximized one back to its own size, as before". At this head, that only holds for windows the open rule floats. A window from another app with a float rule of its own, a modal dialog, or a portal file picker now opens over the maximized window and leaves it maximized, as the new comment in default/hypr/workspace-modes.lua says. Could you add that to the description, so whoever weighs the trade-off sees both halves of it?

This is waiting on the maintainer to decide whether it's a fix or a behaviour change. Once they do, it gets reproduced on a worker and reviewed in full.

@rndaom

rndaom commented Nov 3, 2026

Copy link
Copy Markdown
Author

Added to the description: since 4d8a4e2, a window from another app unmaximizes the maximized one only when the floating mode's open rule places it. A modal dialog, a portal's file picker, or an app with a float rule of its own opens over it and leaves it maximized.

@rndaom

rndaom commented Nov 3, 2026

Copy link
Copy Markdown
Author

Superseded by #17491, which removes unmaximize_others entirely, so a window opened by the maximized app itself (XWayland menus) or a window the mode didn't open no longer un-maximizes it either. The two PRs edit the same function and would conflict.

@rndaom rndaom closed this Nov 3, 2026
@rndaom
rndaom deleted the fix-maximized-app-popups branch November 17, 2026 14:40
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