Skip to content

Bring a minimized window back when it gets focus - #16496

Open
rndaom wants to merge 8 commits into
omacom:quattrofrom
rndaom:fix-minimized-activation
Open

rndaom wants to merge 8 commits into
omacom:quattrofrom
rndaom:fix-minimized-activation

Conversation

@rndaom

@rndaom rndaom commented Oct 24, 2026 •

Copy link
Copy Markdown

Clicking a link while the browser was minimized to the dock showed the whole special:minimized workspace over the screen instead of bringing the browser back. The browser asks to be brought forward (xdg-activation), and with focus_on_activate Hyprland focuses the window where it is, which for a minimized window means opening the special workspace it waits on. Anything else that focuses a minimized window does the same.

From there it gets worse. The store sits above every workspace, so the window stays on top of everything. Its minimize button does nothing, since omarchy-hyprland-window-minimize only works from a numbered workspace. And a window that opens while the store is showing (the browser opened the link in a new window) lands on special:minimized itself, where floating mode does not reach, so it is tiled with no titlebar. Bringing that tiled window back onto a workspace with a maximized window left it drawn on top with its input blocked, so its titlebar buttons could not be clicked.

default/hypr/minimized-windows.lua now watches focus. A window on special:minimized that gets focus comes back to the workspace in front the way the dock brings it: moved without animating in, focused, and raised. The store is closed if other minimized windows would keep it open. Hyprland focuses a window in the store whenever it shows it, so the store never stays on screen and nothing opens into it.

That happens once Hyprland has finished showing the store. It reports focus while it is still showing it, first for the window last focused there and then for the one asked for. Moving a window or closing the store from inside that left Hyprland to finish showing a store it no longer counted as shown: drawn over the screen while hyprctl monitors reported no special workspace, with nothing able to close it, and the other window brought back too. So the window that holds focus once Hyprland is done is the one that comes back.

Testing:

  • A new case in test/shell.d/hyprland-floating-workspaces-test.sh, which fails without the module.
  • A nested Hyprland 0.56.2 running Omarchy's own Lua config, with a GTK test window that asks to be brought forward: a minimized window comes back floating with its titlebar, focused and taking input, with the store closed. That also holds over a maximized window. With two windows minimized, only the one asking comes back. Showing the store by hand brings back the window it focuses. The dock's restore and minimizing again are unchanged. Without the module, 12 of these checks fail.
  • Two test windows on my own two-monitor desktop, both minimized, then one focused: before the second commit both came back and Hyprland's event stream ended with the store opened on the monitor after it had been closed; with it, only the focused one comes back and the store opens and closes once. The test case now reports focus in that order and fails without the second commit.
  • ./test/all: agent-account-copy, battery-status, platform-setup and runtime-smoke fail on this machine, and fail the same way on quattro without this change.

Part of #17890: this fixes the explicit-focus case. The original Nautilus dock failure and the Apps grid trigger on Hyprland 0.56.x are not verified.

@greptile-apps

greptile-apps Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

Focused windows on special:minimized now return to the active numbered workspace instead of leaving the minimized store visible.

  • Focused minimized windows return to the workspace in front.

No actionable issues were found. This review checked code paths and companion repositories; it did not repeat the reported desktop tests.

Diagram

sequenceDiagram
  participant H as Hyprland
  participant M as minimized-windows.lua
  H->>M: window.active on minimized window
  M->>H: Schedule one-shot callback
  H->>M: Further focus changes
  Note over M: Ignore duplicate scheduling
  H->>M: Run callback after current work
  M->>H: Read current focused window
  alt Window remains in minimized store
    M->>H: Move to active numbered workspace
    M->>H: Close store if still visible
    M->>H: Focus and raise restored window
    M->>H: Schedule no_anim reset
  end
Loading

Reviews (9) · Last reviewed commit: "Merge remote-tracking branch 'origin/qua..." · Reviewed by Greptile

@rndaom
rndaom force-pushed the fix-minimized-activation branch from 4e55828 to 8ac2014 Compare October 24, 2026 15:37
A minimized window waits on special:minimized, which only the dock was meant
to bring windows back from. Anything else that focuses one, such as a link
opening in a minimized browser, had Hyprland show the whole store over the
screen: the window stayed above everything, could not be minimized again, and
a window opening meanwhile landed in the store with no floating mode or
titlebar. A minimized window that gets focus now comes back to the workspace
in front the way the dock brings it, and the store is closed.
@rndaom
rndaom force-pushed the fix-minimized-activation branch from 8ac2014 to 841fe72 Compare October 25, 2026 02:51
@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review labels Nov 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 0cb5249 and reproduced on a disposable Omarchy worker (Hyprland 0.57.0), with nothing pushed.

The bug is real, and this fixes it. On a floating workspace I minimized a terminal with omarchy-hyprland-window-minimize, then focused it the way an activation request does. On quattro without this change, the window stayed on special:minimized, Hyprland showed the whole store over the screen, and omarchy-hyprland-window-minimize refused to minimize it again (exit 1). On this branch the window came back to workspace 1, floating with its titlebar, focused, with the store closed. With two windows minimized, only the focused one came back. Minimizing it again afterwards worked, so the module does not undo a minimize.

Before, on quattro: the focused minimized window is drawn with the store shown over the dimmed desktop
After, on this branch: the window is back on workspace 1 and the store is closed

Tests, on the worker: test/shell.d/hyprland-floating-workspaces-test.sh (46 passed) and test/shell.d/dock-test.sh (39 passed), plus ./test/cli, all green. The new case fails with the module removed, and also with only the first commit's version of the module, so it guards the focus-ordering fix as well.

Second opinion: Codex Medium and muse-wonder (high) reviewed the diff. Neither found a defect to fix on the branch. They raised a few points worth knowing:

  • The deferral treats a 1 ms oneshot timer as the moment Hyprland has finished reporting focus while it shows the store. Your testing and mine both show it holding, but nothing in Hyprland promises that ordering. A future release that spreads those focus events further apart would bring back the wrong window, and the test's timer stub ignores the delay, so it would not notice.
  • A minimized window now comes back to whatever workspace is in front, including a tiling one, where it gets tiled and can no longer be minimized. On quattro that case showed the store instead. Whether that is the behaviour you want is the maintainer's call.
  • On a named workspace (negative id), bring_back returns early and the store stays shown, the same as on quattro and the same limit the dock has. This is not a regression.
  • The 400 ms no_anim cleanup is dispatched against the window object, so if the window closes within that time it may land on whichever window has focus instead. The only effect is clearing an override that other window will almost never have, so I left it.

Both reviewers read this session's notes as well as the code, so their agreement is not guaranteed to be independent. I checked the two concerns they raised that live testing could settle: minimizing does not bounce the window straight back, and the store is not toggled back open after Hyprland has already closed it.

Related: #14283 stops browsers from taking focus on activation, which would make this path less common for browsers without conflicting with it. #16548 adds an Alt + Tab switcher that can reach minimized windows.

This is waiting on the maintainer: the fix is verified, and the timer question above is theirs to weigh.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Nov 23, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Rechecked de9728d597dd146bd4c5f15b9cf77c658be20bdb after its merge of newer quattro. The minimized-window handler is unchanged from the earlier review. GPT-6 in Codex (reasoning effort not exposed to this session) reviewed the current diff, surrounding focus/minimize/dock paths, linked issue #17890 and related pull requests. I found no new concrete defect and pushed nothing.

On a fresh disposable Omarchy worker running Hyprland 0.57.2, I minimized two floating terminals with omarchy-hyprland-window-minimize, then targeted one through omarchy-launch-or-focus. On quattro at eb7cfd015d72d5981afc5b4e52adc7eddd9d8274, that showed both windows in special:minimized. On this head, only the targeted window returned to workspace 1, floating and focused, with the store hidden and the other window still minimized. Minimizing the restored window again worked. Removing only this head’s handler registration brought the failure back.

Before, on current quattro: both minimized terminals are exposed over the dimmed desktop

After, on this PR head: only the targeted terminal is restored; compositor state confirms the other remains minimized

On the worker, ./test/cli passed 139 checks, hyprland-floating-workspaces-test.sh passed 45 and dock-test.sh passed 48. These were the CLI suite and focused area tests; the full shell suite was not run. Greptile’s completed review is 5/5 on this head with no findings.

No second code opinion ran for this revision: the configured Opus 5.5 High reviewer failed at its weekly limit, and omabot review --ping confirmed it was unavailable. The additional panel model answered the availability probe only. The readiness judge also returned no readable judgment. The earlier timer and tiled-workspace behavior remain unchanged; this run does not resolve those maintainer questions. Evidence is recorded, and this is waiting on the maintainer for review. The worker has been destroyed.

@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Nov 25, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Rechecked fbc49ecc0fdb7c314c15ffe97e78767f8ed39bb3 after its merge of newer quattro. On a fresh disposable Omarchy worker running Hyprland 0.57.2, I minimized two floating terminals with the shipped helper, then targeted one through omarchy-launch-or-focus. Current quattro at f989b43e91ab16ce3675bd1ec5535e093e907ce0 exposed both windows in special:minimized. This head returned only the target to workspace 1, floating and focused, hid the store, and left the other window minimized. Removing only the handler registration brought the failure back. Minimizing the restored window again kept it hidden.

Before, on current quattro: the minimized store exposes both terminal windows over the dimmed desktop

After, on this head: only the targeted terminal is restored; compositor state confirms the other stays minimized and the store is hidden

On that exact head, ./test/cli passed 143 checks, hyprland-floating-workspaces-test.sh passed 45, and dock-test.sh passed 53, all on the worker. These are the CLI and focused area suites; the repository-wide shell runner was not run. Greptile's completed review is 5/5 at this head with no findings. Nothing was pushed, and the worker has been destroyed.

GPT-6 in Codex (reasoning effort not exposed to this session) reviewed the diff and integration paths. Opus 5.5 High and muse-wonder via pi, thinking high reviewed this exact head and the evidence; neither found an actionable code defect. Their agreement is not guaranteed independent because the review brief included my observations. The timer concern from the earlier review remains hypothetical on the tested stack, and returning the window to the workspace in front matches the stated behavior.

This verifies the explicit-focus case in #17890. Its original Nautilus dock failure and the separate Apps-grid trigger on Hyprland 0.56.x were not verified here. Both reviewers cautioned that the existing Fixes #17890 link would close a report broader than these results establish. I have left this verified for the maintainer to settle that scope.

@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review and removed verified Omarchy Triage has verified that this issue is ready for final review labels Nov 26, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Rechecked a033cbb2864ec2a5054a1919f1ae7cd0c5e1fe53 against current quattro at 745271ccd293fc2e7a233b269004a9926a5c6cb4. The handler is unchanged, and the description now accurately limits #17890 to a partial reference with no auto-close link.

On a fresh disposable Omarchy worker running Hyprland 0.57.2, I minimized two floating foot windows with the shipped helper and targeted one through omarchy-launch-or-focus. The base exposed both in special:minimized; this head restored only the target to workspace 1, floating and focused, closed the store, and left the other minimized. Removing only the handler registration reproduced the failure. Minimizing the restored target again kept both hidden.

Before, on current quattro: the minimized store exposes both terminal windows over the dimmed desktop

After, on this head: only the targeted terminal is shown; compositor state confirms the other remains minimized and the store is hidden

The worker passed ./test/cli (143 checks), hyprland-floating-workspaces-test.sh (45) and dock-test.sh (53). These are the CLI and focused area suites; the full repository shell runner was not run. Greptile completed its 5/5 review of this head with no findings.

GPT-6 in Codex (reasoning effort not exposed to this session) checked the diff and integration paths. Opus 5.5 High and muse-wonder via pi, thinking high reviewed this head and evidence; neither found an actionable code defect. Their agreement is not guaranteed independent because the brief included my observations. Nothing was pushed, and the worker has been destroyed.

This is left for the maintainer's decision. The verification covers explicit focus on a single-monitor, numbered workspace on 0.57.2. Actual browser activation, two monitors, named workspaces, the original Nautilus failure and the Apps-grid trigger on 0.56.x were not verified here; #17890 remains open.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Nov 29, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

On a disposable Hyprland 0.57.2 worker, I tested c86527b8756f6a25bc4be75a0cb63a007dab5867 against quattro at e3c73b38ffab0bb7ccf90da552aa681abf39811e. Explicitly focusing one of two minimized terminals restored only the requested window. After disconnecting a virtual display, a minimized terminal stayed drawn on quattro and with the fullscreen change reverted. It stayed hidden on this head. The CLI, floating-workspaces and dock suites passed 143, 46 and 53 checks respectively.

The fullscreen change also changes what happens when a maximized window returns to a workspace that already has one. Both windows reported maximized on this head. With the fullscreen change reverted, the returning window was maximized and the other returned to its normal size. This PR's focus fix is distinct from the rendering workaround in #20204, which clears fullscreen before the move. The maintainer needs to decide where the workaround belongs. The Tests workflow also awaits maintainer approval.

GPT-6 in Codex ran the worker checks. Opus 5.5 High identified the restore case for follow-up. Muse-wonder via pi with high thinking reviewed the diff and agreed that the fullscreen implementations overlap. The two reviews used a shared brief.

Focus before: the minimized store exposes both terminals
Focus after: only the requested terminal is visible

Display disconnect before: the minimized terminal is still drawn
Display disconnect after: the same part of the desktop is clear

@mchambliss

Copy link
Copy Markdown

Hit this exact behavior on floating workspaces when clicking desktop notifications for minimized apps: focusing the app opens special:minimized as a dimmed scratchpad-like overlay showing every minimized window instead of restoring just that app.

Two notes that may be useful for maintainer review:

  1. Interaction with Focus notification sender windows after invoking their actions #17089: Right now, apps like Chromium PWAs don't trigger this only because Service.qml skips focusWindow() when the sender accepts "default". Once Focus notification sender windows after invoking their actions #17089 lands and omarchy.notifications explicitly focuses the sender window after invoking "default", clicking a notification for any minimized web app or Electron app will also hit special:minimized, making this PR a companion to Focus notification sender windows after invoking their actions #17089 on floating workspaces.

  2. Target workspace on restore (active_workspace vs omarchy-minimized-from-<N>): Regarding the design question raised in the earlier review, I'd prefer restoring the window to the workspace recorded in its omarchy-minimized-from-<N> tag (falling back to monitor.active_workspace if absent) and switching focus there, rather than pulling it onto whichever workspace happens to be active. That avoids dragging a minimized floating app onto a different (potentially tiled) workspace where it gets tiled and can no longer be minimized, and matches the expectation that clicking a notification takes you to the app on the workspace it already lives on.

@omarchybot

Copy link
Copy Markdown
Collaborator

I reproduced the notification click on an Omarchy worker with Hyprland 0.57.2. On current quattro, the click showed both minimized windows. This PR restored only the sender and kept the other window hidden. Disabling the focus handler brought the overlay back.

With this PR applied to current quattro, a click from a tiled workspace restored the window there, matching the dock’s current behavior. The command bound to Super+M still minimized it. GPT-6.2 Sol High in Codex and Opus 5.5 High and muse-wonder via pi, thinking high checked the restore paths, including how #21125 can focus a sender that goes urgent after handling a notification action. Restoring to the original workspace remains a policy decision for the maintainer. The worker also reproduced the fullscreen regression again, with both windows left maximized after a restore.

Before — the notification click exposes both minimized terminals
After — only the notification sender is visible

@rndaom

rndaom commented Dec 4, 2026

Copy link
Copy Markdown
Author

Reverted c86527b8 and merged current quattro. This PR is back to just restoring a minimized window when it gets focus, without touching maximize/fullscreen state or overlapping with #20204.

@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Dec 4, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Recommend: Hold — the maintainer needs to approve the Tests workflow.

On a Hyprland 0.57.2 ISO worker, clicking a minimized terminal's notification exposed both minimized windows on quattro and with the focus handler disabled. This head restored only the sender and hid the store. When a maximized terminal was restored over another, only the restored terminal remained maximized. The CLI, floating-workspace, dock, and notification suites passed.

GPT-6 in Codex (effort not exposed to this session) reviewed the revision and ran the worker checks. Opus 5.5 High agreed and found no defects (independence not guaranteed).

Before — both minimized terminals appear in the overlay
After — only the notification sender is restored

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

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants