Skip to content

Keep a maximized window maximized when another app opens on floating workspaces - #17491

Open
rndaom wants to merge 26 commits into
omacom:quattrofrom
rndaom:fix-maximized-new-window
Open

rndaom wants to merge 26 commits into
omacom:quattrofrom
rndaom:fix-maximized-new-window

Conversation

@rndaom

@rndaom rndaom commented Nov 3, 2026 •

Copy link
Copy Markdown

Fixes #17049.

Stacked on #17361 (itself stacked on #17360), so their commits show here too; only the last two commits are new.

On a floating workspace, opening any other app (from the dock, the launcher, a terminal) un-maximized the maximized window already there: it shrank back to its floating size and the new window opened centered over it. That came from unmaximize_others in default/hypr/workspace-modes.lua, which the mode's window.open handler ran for every new window since the dock landed (#15263).

Now the maximized window stays maximized and the new window floats over it at its own size, as on Windows. The user brings the maximized window forward again with a click, the dock or Alt + Tab, which #17361 already handles.

  • unmaximize_others is gone. Nothing else in the mode un-maximizes on open. True fullscreen (Super + F) was never touched and still isn't.
  • Hyprland doesn't take over the un-maximize. In 0.57 CWindow::mapWindow marks every new floating window allowedOverFullscreen and raises it, and misc:on_focus_under_fullscreen (Omarchy sets 1) only applies to a window that is still tiled at that point. The mode's open rule floats windows from their first frame, so the new window is drawn over the maximized one, takes focus, and is top of the order clicks follow. Focusing a floating window over a maximized one later only brings it over (CFocusState), it never changes the maximize.
  • An app whose file chooser has a float rule opens floating too. A rule matching a class and a title (Nautilus, Sublime Text, OnlyOffice and Inkscape file choosers, Battle.net, Hermes) was recorded in o.floating_apps as two separate exclusions, so the open rule passed over every window of that class. Those apps' main windows opened tiled, and with a maximized window there Hyprland's on_focus_under_fullscreen = 1 gave them the maximize, which is the same symptom by another path. Lua's window.open fires at openLate, after that takeover, so the mode couldn't undo it. o.window now records only the title of such a rule, so the main window floats from its first frame and the file chooser still floats on its own account.
  • Clicks and stacking afterwards use Let clicks reach a window drawn over a maximized one on floating workspaces #17360 and Bring a maximized window to the front when the user focuses it on floating workspaces #17361's drawn_over / keep_over / bring_forward. The new window is claimed by the mode, so a click on the maximized window sends it behind until it is brought forward.

Related work:

Testing:

  • test/shell.d/hyprland-floating-workspaces-test.sh: the case that asserted the old behaviour now checks that a window the open rule floats leaves the maximized one maximized and opens floating at its own size. It fails on Bring a maximized window to the front when the user focuses it on floating workspaces #17361's branch and passes here.
  • The tag-exclusion case in the same file now also checks that a class-and-title rule passes over only the title. It fails without the helpers.lua change.
  • All test/shell.d/hyprland-*-test.sh files pass.
  • Live on my floating desktop (Hyprland 0.57.0) with Steam maximized: opening Files the way the dock does (uwsm-app -- gtk-launch org.gnome.Nautilus.desktop) leaves Steam maximized, and Files opens floating at its own size, focused, top of the stacking order and allowed_over_fullscreen. Before the helpers.lua change, the same launch opened Files tiled and maximized and Steam lost its maximize.

…spaces

Hyprland draws a maximized window under every floating window it lets over
it, whatever their order, but hands a click to the highest in that order.
Once the maximized window was raised, by a click on it or an app asking
for focus, a window still drawn over it passed every click, its titlebar
buttons included, through to the maximized window.

Before Hyprland picks the window under a click, the windows drawn over a
maximized one are now put back above it, so a click goes to what is on
screen. A true fullscreen window keeps the screen to itself and is left
alone.
…ating workspaces

A click on a maximized window, the dock or Alt + Tab now brings it in front
of the windows the mode floated over it, as a click does on Windows. A
dialog or a portal's file picker floating on its own account stays over it,
since its app may wait on it. A window its app asked focus for, as an app
does right after opening a link, leaves the windows over it in view. The
dock also calls o.bring_forward, since focusing the window that has focus
already is no event.
@greptile-apps

greptile-apps Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no new actionable issue was established.RetriggerView in GreptileConfidence Score: 5/5

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

Summary

Keeps existing maximized windows maximized when another app opens on a floating workspace.

  • New windows stay floating over maximized windows on floating workspaces.
  • Title-matched chooser rules no longer exclude every window from their app.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[New app window opens] --> B{Has its own floating rule?}
  B -->|No| C[Workspace rule floats and claims it]
  B -->|Yes| D[Keep its own floating treatment]
  C --> E[Existing maximized window stays maximized]
  D --> E
  E --> F[New window appears above it]
  F --> G[User brings maximized window forward]
  G --> H[Other app windows move behind it]
  G --> I[Its dialogs stay above it]
Loading

Reviews (8) · Last reviewed commit: "Merge branch 'split/bring-maximized-forw..." · Reviewed by Greptile

@rugobal

rugobal commented Nov 5, 2026

Copy link
Copy Markdown

I reproduced this on my installed Omarchy floating-workspace configuration with Hyprland 0.56.2 (efb50993780079460b0cbed1363e2166a2de1d9f):

  1. Maximize a window on a floating workspace.
  2. Open a second, unrelated window.
  3. The first window returns to its previous floating size.

Locally disabling only unmaximize_others(window) kept the first window maximized, but exposed the stacking problem covered by #17360 / #17361: clicking the maximized window behind the smaller window did not bring it visually in front.

My working local workaround replaces maximize with resize/move to fill the monitor's usable area, saving the previous geometry for restore. It applies only on numbered workspaces using Omarchy's floating mode, through the titlebar maximize button, double-click, and Super+Alt+F. Tiling and scrolling workspaces retain native maximize. Monitor scale, reserved bar/dock space, borders, and the Omarchy titlebar are accounted for.

This behaves as expected on my desktop: opening another window preserves the larger window's size, and clicking either window brings it in front. A temporary-window check verified exact size/position restore, with no Hyprland configuration errors.

Sharing this as reproduction evidence and a working local alternative. I have not tested this PR's branch or its dependencies, so this is not a verification of the proposed fix.

An app floating by a rule of its own, such as Steam, was taken for a dialog
and put back over the maximized window on every focus.
A window the mode floated is a window of its own, not a dialog, even when it
shares the maximized window's process.
Folio shows the file pickers of other apps from a process of its own, as
the portal does, so a click on the maximized app sent it behind.
Focus left with a maximized window when another closes, is minimized, or
its workspace is switched to is nobody bringing it forward, yet it sent
every window over it behind. Hyprland gives the reason with the focus.
Hyprland marks a window urgent whenever it grants it focus on request,
which is also how the browser comes forward when a link is opened from a
chat. Only a window that has the focus, or had it moments ago, is taking
it back; any other was sent for, and comes forward.
@omarchybot omarchybot added the enhancement New feature or request label Nov 22, 2026
Comment thread default/hypr/workspace-modes.lua Resolved
@omarchybot

Copy link
Copy Markdown
Collaborator

Classification is unsettled on 7a9dfc484a88b028ece22c8882ed214f85400d1e: I classified this as enhancement because it replaces the explicit unmaximize-on-open policy described by the existing source comment and test; deepseek-v4p1-flash classified it as bug. No new labels were added.

Codex (GPT-6; reasoning effort not exposed to this session) read the diff, discussion, linked #17049 and base-branch rules. deepseek-v4p1-flash (reasoning effort not reported) classified the current diff only; no second-opinion code review or worker tests ran. This waits on maintainer review of the classification before verification.

@omarchybot omarchybot removed the enhancement New feature or request label Nov 25, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Classification remains unsettled on 862c0d9c37b2f30ec63708eb6c9cb6957f9569f0: I classified this as enhancement because it replaces the explicit unmaximize-on-open policy in the existing handler and test with different stacking behavior; deepseek-v4p1-flash classified the current diff as bug. No class label was added.

Codex (GPT-6; reasoning effort not exposed to this session) read the current diff, discussion, inline review, linked #17049 and base-branch rules and handler. deepseek-v4p1-flash (reasoning effort not reported) classified the current diff only; no second-opinion code review or worker tests ran. This waits on maintainer review of the classification before verification.

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.

Floating workspace: opening a second, unrelated window un-maximizes the full-width window

3 participants