omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Idle wake recreates shell panel components without destroying the old ones (duplicate IpcHandlers, leaked child processes)

Open informatica-neumann-edu-pe opened this issue 2 months ago • 8 comments

Summary

After an idle lock → wake cycle, the shell appears to recreate parts of its panel/component tree without cleanly destroying the previous instances. This is visible as duplicate IpcHandler registrations for many built-in panels at once, and — for at least one third-party plugin (Omamail, which owns a real child process rather than just reading shared system state) — it leaks the old instance's backend process as a permanent orphan every time it happens.

This looks related to #11794 (same "no outputs" / "not backed by a valid wayland output" log signature), but that report describes a full session freeze; this one is a quieter case where the session keeps working and the duplication is easy to miss unless a plugin has an externally-visible side effect (like Omamail's does).

Evidence (journalctl --user, times local)

17:09:54  omarchy idle  lock-system: lock-timeout
17:09:54  omarchy lock  secure=true
17:12:24  omarchy idle  idle-monitor: idle / idle-cycle-start
17:12:38  omarchy idle  idle-monitor: active / idle-cycle-cancel: activity
17:12:38  omarchy idle  process-start: wake omarchy-system-wake
17:12:39  qt.qpa.wayland: There are no outputs - creating placeholder screen
17:12:40  WARN scene: QML IpcHandler at .../plugins/agents/Panel.qml[327:3]: Handler was registered
          but will not be used because another handler is registered for target omarchy.agents
17:12:40  WARN scene: QML IpcHandler ... target omarchy.bluetooth
17:12:40  WARN scene: QML IpcHandler ... target omarchy.network
17:12:40  WARN scene: QML IpcHandler ... target omarchy.audio
17:12:40  WARN scene: QML IpcHandler ... target omarchy.monitor
17:12:40  WARN scene: QML IpcHandler ... target omarchy.power
17:12:40  WARN scene: QML IpcHandler ... target omarchy.weather
17:12:40  WARN scene: QML IpcHandler ... target omarchy.system-update
17:12:40  WARN scene: QML IpcHandler ... target omarchy.clock
17:12:40  WARN scene: QML IpcHandler ... target omarchy.indicators
17:12:40  WARN: Layershell screen does not correspond to a real screen. Letting the compositor pick.
17:12:40  DEBUG: Not creating lock surface for screen QScreen(...) as it is not backed by a valid wayland output.

The whole 17:12:40-17:12:41 block repeats twice in a row, once per (apparently) recreated screen/output — each time re-registering an IpcHandler for every one of these targets, and each time losing that registration race ("will not be used because another handler is registered"), which means the previous instance is the one that's still alive and serving — the new one is the one left dangling.

Concrete downstream impact

The Omamail mail plugin (a third-party Omarchy plugin, not part of core) spawns its own long-lived backend process per plugin instance. Each time this duplication happens, the old plugin instance's backend process is never told to quit — it becomes a permanent orphan (reparented to systemd --user), while a fresh instance and fresh backend process are created. Over a few days of normal idle/lock/wake cycles, 2-3 of these orphaned processes accumulate, each still fully connected to its accounts and holding shared resources (an exclusive file lock, in this case), causing real functional failures in that plugin. Filed separately against that plugin's repo as a defensive mitigation, but the leak itself originates here.

Other built-in panels (bluetooth, network, clock, etc.) don't show a visible symptom from this because they only display state already owned by a system service (D-Bus, NetworkManager, etc.) — a duplicated, losing-race instance of those is just a few harmless orphaned QML objects. A plugin or panel that owns its own external process or exclusive resource will leak it every time this happens.

Steps to reproduce

  1. Let the idle timeout lock the session (or lock manually).
  2. Stay away long enough for the display to fully blank/the output to drop (not just the lock surface appearing).
  3. Return and unlock/wake.
  4. Check journalctl --user around the wake timestamp for the IpcHandler ... will not be used warnings shown above.
  5. If you have a plugin that owns a child process, check whether a second copy of that process now exists (ps -eo pid,ppid,etime,cmd | grep <plugin binary>) alongside the original.

Environment

  • Omarchy 4.0.4-1
  • Session stayed usable throughout (unlike #11794) — this is the "quiet" variant of that failure family.

Suggested direction

  • Whatever teardown path handles a real lock-screen freeze recovery (per #11794 and siblings) should also run for this quieter case: ensure the previous scene/component tree (and anything it owns, like plugin-spawned processes) is torn down before — or instead of racing with — creating the replacement one, rather than leaving the loser of the IpcHandler registration race running indefinitely.

Same signature here, on a single external monitor, with a user-visible consequence: after the wake, Super+Space (Omarchy menu) silently did nothing until omarchy restart shell.

Setup: ASUS NUC 15 Pro+ (Intel i915), one Samsung Odyssey G70NC on HDMI (no laptop panel). Omarchy 4.0.0.r6663.g3faafba, quickshell 0.3.1-1, hyprland 0.56.2-3, kernel 7.2.5-4-omarchy.

Timeline (journalctl --user, local time, 2026-09-28):

19:37 (prev. evening)  omarchy lock  secure=true      # locked overnight, display off
10:28:59  omarchy idle  idle-monitor: active
10:29:00  qt.qpa.wayland: There are no outputs - creating placeholder screen   (x2)
10:29:00  WARN scene: ... Handler was registered but will not be used because another handler is registered for target omarchy.agents
          ... same for omarchy.bluetooth / network / audio / monitor / power / weather / tailscale /
              dropbox / clock / indicators / system-update / elsewhen, plus third-party plugin targets
10:29:00  DEBUG: Not creating lock surface for screen QScreen(..., name="") as it is not backed by a valid wayland output.
10:29:01  WARN quickshell.hyprland.ipc: Got removal for monitor "FALLBACK" which was not previously tracked.
10:29:04  omarchy lock  unlocked

69 duplicate-handler warnings in that one second, i.e. each panel's component tree was instantiated several extra times while only the placeholder screen existed.

Consequence: after unlocking, the session looked normal but Super+Space (o.bind("SUPER + SPACE", "Omarchy menu", { menu = "root" })) opened nothing. omarchy restart shell fixed it immediately, and the fresh shell logs zero duplicate-handler warnings. Note that omarchy.menu itself was not among the duplicated targets, so the menu failure may come from the menu bar widget being bound to the placeholder/FALLBACK screen rather than from a handler collision. I have not confirmed which.

Trigger: on this machine the "no outputs" moment comes from the monitor briefly dropping off the bus (it does this periodically while the display is off), not only from a normal idle wake. I've seen the identical sequence on 2026-09-27 as well, so it's reproducible here whenever the output disappears and comes back.

Happy to collect more (quickshell log.log, hyprctl monitors before/after) if useful.

rlf3iii avatar Sep 28 '26 15:09 rlf3iii

Another data point for this: a second third-party plugin hits the same failure shape as the Omamail case.

matjam/omajam (an MPD client) spawns its backend as a child process via Quickshell.Io.Process, same "plugin owns an exclusive external resource" shape as Omamail. Journal from one affected wake:

Sep 29 20:31:45 omarchy-shell[980]: WARN scene: QML IpcHandler at .../panels/monitor/Panel.qml[220:3]: Handler was registered but will not be used because another handler is registered for target omarchy.monitor
Sep 29 20:31:45 omarchy-shell[980]: WARN scene: QML IpcHandler at .../matjam.omajam/BarWidget.qml[164:3]: Handler was registered but will not be used because another handler is registered for target matjam.omajam
Sep 29 20:31:50 omarchy-shell[980]: WARN quickshell.hyprland.ipc: Got removal for monitor "FALLBACK" which was not previously tracked.

Both a first-party panel and a third-party plugin lose the registration race at the same timestamp, right as FALLBACK is torn down on wake (session had been idle-locked ~3.5h). Net effect for a plugin like this: the orphaned instance's backend never connects, and the widget stays silently stuck until omarchy restart shell.

Flagging since neither #13645 nor #13477 mentions cleaning up what the old component tree owns (spawned processes, sockets) — worth covering alongside the QML re-parenting fix.

jabular avatar Sep 29 '26 20:09 jabular

Same thing here on a single DisplayPort monitor. I think I've found why Super+Space goes dead, and it isn't covered by #13645 or #13477 (both only touch shell/plugins/bar/).

Setup: i9-10850K, Intel Arc A750 (DG2), one 5120x1440 monitor on DP-3. Omarchy 4.0.0.r6691.g8b4eae6, hyprland 0.56.2-3, quickshell 0.3.1-1, kernel 7.2.5-4-omarchy.

Log (2026-09-30, deduplicated):

12:28:17 WARN quickshell.hyprland.ipc: Got removal for monitor "DP-3" which was not previously tracked.
12:28:17 INFO qt.qpa.wayland: There are no outputs - creating placeholder screen
12:28:17 WARN scene: QML ShellIpc ... Handler was registered but will not be used because another handler is registered for target omarchy.bluetooth
         (same for agents, network, audio, monitor, power, weather, system-update, clock, indicators, elsewhen)
12:28:17 WARN: Layershell screen does not correspond to a real screen. Letting the compositor pick.
12:28:17 DEBUG: Not creating lock surface for screen QScreen(..., name="") as it is not backed by a valid wayland output.
12:28:18 WARN quickshell.hyprland.ipc: Got removal for monitor "FALLBACK" which was not previously tracked.

What's actually missing: Ui/OverlayWindow.qml keeps its surface alive all the time, parked as a 1x1 layer when closed. But after the dropout, hyprctl layers showed only omarchy-background and omarchy-bar on DP-3. There was no omarchy-menu layer, and no omarchy-clipboard, omarchy-emojis, omarchy-osd, omarchy-reminders or omarchy-image-selector either. Everything else still worked:

  • hyprctl globalshortcuts still listed omarchy:menu.root
  • omarchy-menu ping returned ok
  • omarchy-menu toggle root exited 0 but created no layer surface

After omarchy restart shell, all six overlays came back as 1x1 parked layers, and toggling the menu grew omarchy-menu to full screen as expected.

So the overlay windows seem to lose their surface when their output goes away (probably the placeholder/FALLBACK surface is torn down along with FALLBACK), and nothing maps them again when the real output comes back. targetScreen is only refreshed in onShownChanged, and even a fresh toggle didn't bring the surface back. I haven't confirmed the exact mechanism inside OverlayWindow, but the bar-only screen filtering in the open PRs wouldn't cover these windows.

Workaround until it's fixed: a Hyprland hl.on("monitor.added", ...) hook that waits a few seconds, checks hyprctl layers -j for the omarchy-menu namespace, and runs omarchy restart shell if it's gone (skipped while omarchy-shell lock isLocked is true).

vibeviking avatar Sep 30 '26 12:09 vibeviking

Reproduced on another machine, with the same symptom:

  • Omarchy: 4.0.0.r6663.g3faafba-1
  • Hyprland: 0.56.2
  • Quickshell: 0.3.1-1
  • Kernel: 7.2.5-4-omarchy
  • Hardware: Dell Inspiron 5402, Intel Iris Xe/i915
  • Displays: 3 active outputs (DP-1, HDMI-A-1, eDP-1)

Steps:

  1. Lock the session.
  2. Unlock it.
  3. Super+Space no longer opens the Omarchy menu. Super+W continues to work.
  4. The Super+Space binding remains registered in Hyprland and there are no config errors.
  5. omarchy menu ping returns ok, and omarchy menu summon root opens the menu successfully.
  6. omarchy restart shell restores Super+Space immediately. Reloading Hyprland also succeeds.

This looks like the menu overlay/surface is lost during the lock/unlock output transition while the IPC endpoint and Hyprland binding remain alive. The behavior matches the reports in this issue.

niendicker avatar Oct 06 '26 11:10 niendicker

Heads-up for anyone retesting: #14458 ("Keep overlays sharp without parked surfaces") merged to quattro on Oct 7. Overlays are now unmapped when closed and remapped onto a connected screen when their output goes away. That targets the "Super+Space does nothing after wake, omarchy restart shell fixes it" symptom @vibeviking traced to the lost omarchy-menu layer.

I don't think it covers the other half of this report: duplicate IpcHandler registrations, and plugin child processes (Omamail, omajam) orphaned when the component tree is rebuilt during the placeholder/FALLBACK screen phase. Could someone on quattro/dev past #14458 confirm whether (1) the menu still dies after a long lock and (2) the Handler was registered but will not be used burst still shows up? Related: #14284 and #13995 (same duplicate-handler mechanism, different triggers).

jandrusk avatar Oct 08 '26 13:10 jandrusk

Reproduced on a worker (Omarchy ISO VM, Hyprland 0.56.2, quickshell 0.3.1, one virtual output) at quattro defbf90e. I disabled the only output and turned it back on, three times. Each time Qt created its placeholder screen and every bar panel logged "Handler was registered but will not be used": 12 times per target over the three cycles, for omarchy.agents, audio, bluetooth, clock, indicators, monitor, network, power, system-update, weather, workspaces and omacom.elsewhen. A bar also stayed built on FALLBACK while the output was off.

What happens. The old panels are destroyed, but each one gets a short-lived copy first. shell/plugins/bar/Bar.qml builds one bar per entry in Quickshell.screens. When the last output goes, Qt adds its nameless placeholder screen before it removes the real one, and Hyprland adds FALLBACK after that. Each of those screens briefly gets a full bar of its own beside the old one. Each new copy registers its IPC targets while the old copy still holds them, so it loses, then the old copy is destroyed and the survivor serves the target. Afterwards quickshell ipc show listed every target once, panels opened over IPC, and omarchy-menu toggle root mapped the menu, which matches #14458 having fixed the dead Super+Space half.

The leaked processes. I tested this with a minimal quickshell config: one window per screen, each owning a Process. When a copy is destroyed, quickshell kills the process it started directly, and a fresh one replaces it. Anything that process had started itself is not killed: it is reparented and keeps running. That came to two orphans for every time an output went away or came back, one from each short-lived copy. So the orphans come from both sides. The shell builds and tears down plugin instances for screens that exist for a second, and a plugin whose backend runs behind a wrapper (bash -c, a launcher script, anything that forks) leaves the real backend behind every time an instance is torn down.

Fix. Open PR #13165 builds bars only for named, sized screens other than FALLBACK. With it merged onto the same quattro, the same three cycles logged no "will not be used" warnings at all, no bar was built while only the placeholder and FALLBACK existed, one bar came back each time, and panels and the menu still opened. The bar on an output that really goes away is still destroyed and rebuilt when it returns. So a plugin backend that is not the direct child of its Process would still be orphaned once per dropout. That needs a change in the plugin: exec its backend, or stop it when the instance is destroyed. Issue #13163 has the same root cause with a different symptom: a stacked bar after a KVM switch.

Checked by Claude Opus 5.5. No second opinion ran: the configured reviewer (Codex Medium) answered a ping, but omabot's daily review budget was already spent. I tried to mark #13165 as fixing this issue, and omabot declined because #13165 has changed since it was last classified. Whether to merge #13165 is the maintainer's decision.

omarchybot avatar Oct 12 '26 12:10 omarchybot

Still reproducible on the stable 4.0.6 release (published 2026-10-19). #14458 / 0a55a3c55 is on quattro only; the installed shell has no Ui/OverlayWindow.qml at all. On this machine the damage also covers third-party bar plugins, not just the menu.

Setup: AMD laptop, internal panel (eDP-1) disabled, one Lenovo D32qc-20 on HDMI-A-1 as the only active output. Omarchy 4.0.6-1, quickshell 0.3.2.r7.g2b4501a-1 (omarchy repo), hyprland 0.56.2-4, kernel 7.2.8-9-omarchy. ~39 third-party plugins installed.

What happens: the monitor drops off (DPMS/standby) right before the idle lock and suspend. After resume and unlock, plugin widgets and panels are dead until omarchy restart shell. Seen on 2026-10-23 and 2026-10-25, same signature both times.

Log (deduplicated, one instance):

2026-10-24 08:21:00  WARN: QQmlVMEMetaObject: Internal error - attempted to evaluate a function in an invalid context   (x40+)
2026-10-24 08:21:00  INFO qt.qpa.wayland: There are no outputs - creating placeholder screen
2026-10-24 08:21:00  WARN: Layershell screen does not correspond to a real screen. Letting the compositor pick.
2026-10-24 08:21:00  WARN quickshell.hyprland.ipc: Got removal for monitor "FALLBACK" which was not previously tracked.
2026-10-24 08:21:00  WARN scene: @Ui/WidgetButton.qml[42:-1]: TypeError: Property 'hideTooltip' of object WidgetBarApi(0x...) is not a function
2026-10-24 08:21:00  omarchy lock lock-requested / lock-pending: screen-stabilizing / secure=true
   ... suspend ...
2026-10-25 12:11:25  omarchy lock unlocked
2026-10-25 12:11:28  WARN: QQmlVMEMetaObject: Internal error - attempted to evaluate a function in an invalid context   (x3)

Around the output loss, the usual duplicate batch QML IpcHandler ... Handler was registered but will not be used because another handler is registered for target ... appears for built-in panels (omarchy.network, .audio, .bluetooth, .monitor, .power, .system-update) and for every third-party plugin that registers one. The invalid context flood and the hideTooltip TypeError suggest the old widget trees are still alive and their bindings keep firing against a destroyed context, so they don't just shadow the new IPC handlers.

Workaround in use: a small user service tails journalctl --user -t omarchy-shell. After a There are no outputs line, the next omarchy lock ... unlocked line triggers omarchy-restart-shell, which already refuses to run while the session is locked.

UnderStackDev avatar Oct 25 '26 10:10 UnderStackDev

Rechecked on a worker (Omarchy ISO VM, Hyprland 0.57, one virtual output) at current quattro 175e63b. I disabled the only output and re-enabled it three times while polling hyprctl layers every 100 ms.

What changed on quattro. #17229 (merged Nov 1, not in a release yet) makes each built-in IPC target enable only its first handler, and hands it to the next copy when that one goes. So the "Handler was registered but will not be used" burst no longer appears for built-in panels: 0 across the three cycles. The bars behind it are still built, though. In two runs a bar sat on FALLBACK while the output was off (83 and 70 samples), and after reconnecting Virtual-1 briefly had two bars at once (16 and 14 samples). Each of those short-lived bars is a full set of widgets, plugin instances included. A third-party plugin that declares its own IpcHandler doesn't go through #17229's takeover, so it still warns, and any process it starts is started and torn down with each copy.

The fix is still #13165. With it merged onto the same quattro, the same three cycles built no bar on FALLBACK and never put more than one bar on an output. It filters the bar's screens before anything is built, so the short-lived widget copies are never created. As before, a bar on an output that really goes away is destroyed and rebuilt when the output returns. So a plugin backend that isn't the direct child of its Process can still be orphaned once per dropout, and that needs the plugin to exec its backend or stop it on destruction. I tried to mark #13165 as fixing this issue again, and omabot refused because #13165 has been pushed to since it was last classified. #15439 also touches this code, but its screen filter lets a FALLBACK output with a real size through.

On 4.0.6 (@UnderStackDev). #14458, the fix for the menu and overlays going dead after wake, is in v4.5.0-rc1 and rc2, not 4.0.6. The invalid context flood and hideTooltip is not a function couldn't be tied to this mechanism. On quattro, every bar API that widgets receive defines hideTooltip. The errors may come from teardown of the real bar, which #13165 doesn't prevent, or from the short-lived copies it removes. Timestamping them against the moment the output goes off and the moment it comes back would tell those apart. Also, the trigger here is the last output being removed. A DPMS blank that leaves the output connected doesn't create the placeholder screen.

Checked by Claude Opus 5.5, with Codex Medium and muse-wonder (via pi, thinking high) as second opinions. Both agreed with the mechanism and that #13165 fixes the shell's part. Their independence is not guaranteed. Both raised the 4.0.6 errors and the remaining orphan per real dropout as not established or not covered. I did not re-count orphaned processes in this run: the layer counts show the short-lived copies are gone, and orphan counts are not measured. Whether to merge #13165 is the maintainer's decision.

omarchybot avatar Nov 02 '26 00:11 omarchybot