Skip to content

Keep a maximized window maximized when another opens on a floating workspace - #21491

Open
naseebnaushad wants to merge 1 commit into
omacom:quattrofrom
naseebnaushad:keep-maximized-on-floating-open
Open

naseebnaushad wants to merge 1 commit into
omacom:quattrofrom
naseebnaushad:keep-maximized-on-floating-open

Conversation

@naseebnaushad

Copy link
Copy Markdown

What changes

On a floating workspace, opening any window un-maximizes the maximized window already there: it drops back to its floating size and the new window opens over it in the middle of the screen. A maximize the user asked for is undone by opening an app.

The cause is unmaximize_others in default/hypr/workspace-modes.lua, which the mode's window.open handler runs for every new window. The mode never maximizes anything itself, so this can only ever undo a maximize the user chose. Making room for the new window is already done by the open rule, which places it at its own size. And XWayland menus, tooltips and notification toasts arrive as windows too, so the same call also un-maximizes an app when it opens its own menu or tooltip.

This removes unmaximize_others and its call, nothing else. The new window opens over the maximized one, as on other desktops, and the maximized window comes forward again with a click, the dock or Alt + Tab. True fullscreen (Super + F) was never touched by this function and still isn't.

Fixes #17049. Also fixes #16736 and the trigger #21426 was closed as a duplicate of (an app's own XWayland menu, tooltip or toast un-maximizing it).

#17491 removes the same function as part of a larger change stacked on #17361 and #17360, and currently conflicts with quattro. This is only the removal, so it can land on its own; if you'd rather take #17491, close this one.

Verification

  • bash test/shell.d/hyprland-floating-workspaces-test.sh on quattro (28d0d07) with Lua 5.5.1: 45 cases pass. The case that asserted the old behaviour now asserts that a maximized window on a floating workspace stays maximized when another window opens there, and still that one on a tiled workspace does. With the new test and the old workspace-modes.lua, it fails: a maximized window was unmaximized when another opened on its floating workspace.
  • git grep unmaximize_others finds nothing else.
  • Not checked yet: a live Hyprland session with this branch installed. I hit the bug on 4.5.0 and will add a before and after recording once I've run the fix there.

Screenshots

No new UI: the maximized window simply keeps its size when another window opens over it on a floating workspace.

@greptile-apps

greptile-apps Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge.

Summary

Keeps a maximized window maximized when another window opens on its floating workspace.

  • A maximized window stays maximized when another opens on its floating workspace.

Acknowledgment: naseebnaushad explicitly noted that live Hyprland verification is still pending and said a before-and-after recording would follow.

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

@omarchybot omarchybot added the bug Something isn't working label Dec 3, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Recommend: Don't merge — prefer #17491 once its conflicts with quattro are resolved.

On a Hyprland 0.57.2 ISO worker, a second terminal shrank the maximized window on quattro and opened over it at 780e004. All 45 focused tests passed, and reverting the Lua change brought back the failure. A terminal using Nautilus’s app ID, org.gnome.Nautilus, still opened tiled and took over maximization. #17491 also addresses that window-rule path.

Codex High and Opus 5.5 High checked the remaining case. Muse Wonder (Pi, High) reviewed the competing diffs.

On quattro, the first terminal shrinks when the second opens.

On this PR, the first terminal stays maximized behind the second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

2 participants