Skip to content

feat(bar): add focused window details popout - #3139

Merged
bbedward merged 4 commits into
duxlabs-dev:masterfrom
hthienloc:feat/focused-window-widget-details
Aug 21, 2026
Merged

bbedward merged 4 commits into
duxlabs-dev:masterfrom
hthienloc:feat/focused-window-widget-details

Conversation

@hthienloc

@hthienloc hthienloc commented Aug 21, 2026 •

Copy link
Copy Markdown
Member

Description

Adds a standard DMS popout when clicking the focused window widget. The popout shows the app ID, title, and PID, with actions to copy values, add a window rule, or kill the process.

PID resolution only runs when the widget is clicked to avoid adding continuous work to the bar.

Review follow-ups resolve PID from the displayed window identity on multi-monitor and multi-instance setups, hide window rules on unsupported compositors, reuse existing Unknown/Untitled translation terms, and preserve app ID substitutions in the popout header.

Type of change

  • New feature (non-breaking change that adds functionality)

Related issues

Closes #2747

Screenshots / video

recording_20260822_004648.mp4

@hthienloc

Copy link
Copy Markdown
Member Author

/claude review

@claude

claude Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Claude review

Solid feature and it follows the existing popout/execDetached conventions closely, but the PID resolution can point at the wrong process.

  • PID is resolved from the compositor's globally focused window instead of activeWindow, so on multi-monitor the popout can show one window's title with another window's PID — and kill the wrong process. quickshell/Modules/DankBar/Widgets/FocusedApp.qml:37-49
  • "Add Window Rule" is offered on compositors where window rules are unsupported; the settings tab and the IPC path both gate on niri/Hyprland/mango. quickshell/Modules/DankBar/Widgets/FocusedWindowContextMenu.qml:170
  • New i18n terms Unnamed / Unknown application duplicate existing Untitled / Unknown in en.json. quickshell/Modules/DankBar/Widgets/FocusedWindowContextMenu.qml:106

Checked: DankPopout wiring and setTriggerPosition/positioning usage against BatteryPopout, PopoutService.windowRuleModalLoader + WindowRuleModal.show() signature, Theme/BlurService/Paths/ToastService symbols, the acceptedButtons change against BasePill's underlying MouseArea (right-click and wheel still propagate), and the kill/dms cl copy invocations (array form, no injection). Model: claude-opus-5.

@hthienloc

Copy link
Copy Markdown
Member Author

/claude review


readonly property string appId: currentWindow?.appId || ""
readonly property string windowTitle: currentWindow?.title || ""
readonly property string appName: appId ? Paths.getAppName(appId, DesktopEntries.heuristicLookup(appId)) : I18n.tr("Unknown")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lookup skips Paths.moddedAppId(), so the popout can show a different app name than the bar widget it opens from.

FocusedApp.updateDesktopEntry() (FocusedApp.qml:160) does heuristicLookup(Paths.moddedAppId(appId)), and moddedAppId applies the user's SettingsData.appIdSubstitutions. With a substitution configured, the bar resolves the entry for the replacement id while this resolves it for the raw id — so the header falls back to the raw app id (or a different entry) right next to the substituted name in the bar. (The icon is unaffected: getAppIcon calls moddedAppId internally.)

Suggested change
readonly property string appName: appId ? Paths.getAppName(appId, DesktopEntries.heuristicLookup(appId)) : I18n.tr("Unknown")
readonly property string appName: appId ? Paths.getAppName(appId, DesktopEntries.heuristicLookup(Paths.moddedAppId(appId))) : I18n.tr("Unknown")

model: [
{ label: I18n.tr("App ID"), value: root.appId, copyable: !!root.appId },
{ label: I18n.tr("Title"), value: root.windowTitle || I18n.tr("Untitled"), copyable: !!root.windowTitle },
{ label: I18n.tr("PID"), value: root.pid > 0 ? root.pid.toString() : I18n.tr("Unavailable"), copyable: root.pid > 0 }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"PID" is the only genuinely new term this PR adds — App ID, Title, Unavailable, Untitled, Unknown, Add Window Rule, Kill Process and Copied to clipboard all already exist in quickshell/translations/en.json, but PID does not (only Copy PID does). CONTRIBUTING asks for a translator context on new strings, otherwise the term reaches POEditor bare and a three-letter acronym is not translatable on its own.

Suggested change
{ label: I18n.tr("PID"), value: root.pid > 0 ? root.pid.toString() : I18n.tr("Unavailable"), copyable: root.pid > 0 }
{ label: I18n.tr("PID", "Label for the process ID row in the focused window popout"), value: root.pid > 0 ? root.pid.toString() : I18n.tr("Unavailable"), copyable: root.pid > 0 }

@claude

claude Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Claude review

Previous round is addressed — PID now resolves from activeWindow itself and the window-rule row is compositor-gated. Two minor issues left.

  • App name lookup skips Paths.moddedAppId(), so with appIdSubstitutions configured the popout header can disagree with the bar widget. quickshell/Modules/DankBar/Widgets/FocusedWindowContextMenu.qml:16
  • New i18n term PID has no translator context (all other strings in the file already exist in en.json). quickshell/Modules/DankBar/Widgets/FocusedWindowContextMenu.qml:107

Checked: re-verified the multi-monitor PID path (resolveSortedWindow identity/title matching against CompositorService.sortedToplevels, niri/mango enriched-object shape, Hyprland lastIpcObject.pid, 0 fallback keeps Kill disabled); acceptedButtons: Qt.LeftButton vs BasePill's z:-1 MouseArea (right-click/wheel still reach it; left-click ripple no longer fires and BasePill.clicked has no listeners); DankPopout wiring — screen set via setTriggerPosition before toggle(), positioning: "" matches BatteryPopout, popupHeight/implicitHeight chain has no binding loop, Escape already handled by focusHelper; PopoutService.windowRuleModalLoader + WindowRuleModal.show(window); Theme.errorHover/spacingXXS/outlineVariant, BlurService.hoverColor, ToastService.showInfo, DankRipple self-anchoring; kill/dms cl copy array-form invocations match ProcessContextMenu; en.json/template.json untouched. Model: claude-opus-5.

@bbedward

Copy link
Copy Markdown
Member

/claude review

@claude

claude Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Claude review

No issues found.

Both previous-round findings are fixed: the popout header now resolves the desktop entry through Paths.moddedAppId() (FocusedWindowContextMenu.qml:16, matching FocusedApp.updateDesktopEntry()), and I18n.tr("PID", ...) carries translator context (FocusedWindowContextMenu.qml:107).

Checked: resolveActiveWindowPid() per compositor — niri/mango go through resolveSortedWindow() against CompositorService.sortedToplevels (the new sourceToplevel field is present on both enriched paths, sortToplevels and _matchAndEnrichToplevels, and is not shadowed by the for (let prop in bestMatch) copy), Hyprland via lastIpcObject.pid (populated repo-wide), everything else falls back to 0 so the PID row reads Unavailable and Kill stays disabled; the sourceToplevel addition does not affect _toplevelListEquivalent or any toplevel serialization (there is none). Popout wiring: screen is set by setTriggerPosition() before toggle(), so impl is loaded when open() runs; positioning: "" matches the other nine popouts; popupHeight <- contentLoader.item.implicitHeight <- Column of fixed-height children is loop-free; Escape is handled by DankPopoutStandalone.focusHelper; DankRipple self-anchors. acceptedButtons: Qt.LeftButton still lets right-click and wheel reach BasePill's z:-1 MouseArea, and nothing listens to BasePill.clicked for this widget. Strings: App ID, Title, Untitled, Unknown, Unavailable, Add Window Rule, Kill Process, Copied to clipboard all already exist in en.json; PID is the only new term and has context; en.json/template.json untouched; no settings QML, so no search-index regen. kill / dms cl copy use array-form execDetached (no injection). Model: claude-opus-5.

@bbedward
bbedward merged commit a669253 into duxlabs-dev:master Aug 21, 2026
1 check passed
@purian23

Copy link
Copy Markdown
Member

This is a super cool idea, nice work!

marcusramberg pushed a commit to marcusramberg/DankMaterialShell that referenced this pull request Sep 2, 2026
* feat(bar): add focused window details popout

* fix(bar): address focused window review

* fix(bar): resolve focused window pid by identity

* fix(bar): refine focused window translations
@hthienloc
hthienloc deleted the feat/focused-window-widget-details branch November 15, 2026 15:38
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.

Make focused window widget more useful

3 participants