Skip to content

Register each bar widget's IPC target once, not once per monitor - #14960

Open
omarchybot wants to merge 2 commits into
quattrofrom
fix/issue-9975
Open

omarchybot wants to merge 2 commits into
quattrofrom
fix/issue-9975

Conversation

@omarchybot

@omarchybot omarchybot commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

On a desktop with more than one monitor, every shell start logged "Handler was registered but will not be used" once per extra screen for each bar panel and widget with its own IPC target: omarchy.agents, omarchy.audio, omarchy.bluetooth, omarchy.clock, omarchy.indicators, omarchy.monitor, omarchy.network, omarchy.power, omarchy.system-update and omarchy.weather. The bar is built once per screen (Variants over Quickshell.screens in shell/plugins/bar/Bar.qml), and each copy of a widget declared its own ShellIpc. Quickshell keeps the first registration of a target and warns for the rest, so the warnings were noise around a handler that already worked. They also buried real IPC problems in the journal.

Ui/BarWidget.qml and Ui/Panel.qml now carry ipcOwner, which is true only for the first copy of the widget that bar.moduleWidgets() lists, and every per-widget ShellIpc is enabled on it. The other copies already receive refreshes through broadcast(). When the owner's monitor goes away, the next copy becomes the owner. A copy claims nothing until the bar has injected bar and moduleName. Letting a copy the bar has not listed yet register and then drop out makes quickshell 0.3.1 segfault repeatedly during startup with two outputs. The weather panel sits inside its bar widget, which is the copy the bar lists, so it follows the widget's ipcOwner.

Which copy a direct call such as omarchy-shell omarchy.agents toggle reaches is still the first one, as it was before; this change does not make that call follow the focused monitor. The panel hotkeys already go through shell toggle, which picks the focused monitor's copy.

test/shell.d/bar-ipc-owner-test.sh checks that every such handler is gated, and that two copies register a target once, hand it over when the first goes, and answer through quickshell ipc afterwards. runtime-smoke-test.sh used to allow one collision per extra screen and now allows none.

Reviewed by Claude Opus 5.5, and by Codex Medium as a second opinion whose last round found nothing open; its independence from the first review is not guaranteed.

Fixes #9975

omarchybot and others added 2 commits October 11, 2026 05:26
The bar is built per monitor, and every panel and widget carrying its own ShellIpc registered its target on each copy. Quickshell keeps the first and logs "Handler was registered but will not be used" for the rest, so a two-monitor desktop logged ten of these on every shell start.

Only the first copy the bar lists now registers. The others already reach through broadcast(), and when that copy's monitor goes away the next one takes the target over. A widget registers nothing until the bar has injected it: claiming the target first and dropping it a moment later makes Quickshell crash during startup. The weather panel lives inside its bar widget, which is the copy the bar lists, so it follows the widget.

Fixes #9975

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The source check accepted any enabled line that mentioned ipcOwner, including a comment, and passed when it found no handler at all. The fixture counted enabled handlers without asking Quickshell, so a handler that failed to register would still pass; it now calls the remaining copy's target through quickshell ipc.

Co-Authored-By: Codex Medium <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

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

Summary

The PR lets only the first listed copy of each bar widget register its IPC target.

  • Only the first live copy of each bar widget or panel registers its IPC target.

No actionable issues were found. Tests were inspected but not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Per-screen widget copies] --> B[Shared bar module list]
  B --> C[First listed copy]
  C --> D[Enabled IPC handler]
  D --> E[Direct panel action]
  D --> F[Broadcast refresh to all copies]
  B --> G[Owner removed]
  G --> H[Next listed copy owns IPC]
Loading

Reviews (1) · Last reviewed commit: "Check the IPC owner gate strictly and ca..." · Reviewed by Greptile

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.

Multi-monitor: every panel plugin registers its IpcHandler once per bar, logging a "Handler was registered but will not be used" WARN per extra screen

1 participant