diff --git a/modules/PowerMenu.qml b/modules/PowerMenu.qml index 59ab4b6..5c6f38f 100644 --- a/modules/PowerMenu.qml +++ b/modules/PowerMenu.qml @@ -11,12 +11,16 @@ PanelWindow { required property real anchorX signal menuClosed() - signal runCommand(var cmd) readonly property bool _isNiri: Quickshell.env("NIRI_SOCKET") !== "" + Process { + id: runner + } + function _run(cmd) { - runCommand(cmd); + runner.command = cmd; + runner.running = true; menuClosed(); } diff --git a/modules/PowerProfile.qml b/modules/PowerProfile.qml index 904492f..236437a 100644 --- a/modules/PowerProfile.qml +++ b/modules/PowerProfile.qml @@ -51,7 +51,9 @@ M.BarIcon { onClicked: { const cycle = ["performance", "balanced", "power-saver"]; const idx = cycle.indexOf(root.profile); - setter.next = cycle[(idx + 1) % cycle.length]; + const next = cycle[(idx + 1) % cycle.length]; + root.profile = next; + setter.next = next; setter.running = true; } } diff --git a/modules/WindowTitle.qml b/modules/WindowTitle.qml index de1661a..8f56968 100644 --- a/modules/WindowTitle.qml +++ b/modules/WindowTitle.qml @@ -48,13 +48,9 @@ M.BarSection { try { const ev = JSON.parse(line); if (ev.WindowFocusChanged !== undefined) { - // WindowFocusChanged only gives id, re-query for full info - if (ev.WindowFocusChanged.id !== null) - initProc.running = true; - else { - root._title = ""; - root._appId = ""; - } + const w = ev.WindowFocusChanged.window; + root._title = w ? (w.title || "") : ""; + root._appId = w ? (w.app_id || "") : ""; } else if (ev.WindowOpenedOrChanged !== undefined) { const w = ev.WindowOpenedOrChanged.window; if (w.is_focused) { diff --git a/modules/Wlogout.qml b/modules/Wlogout.qml index 32dc365..2f4e9ed 100644 --- a/modules/Wlogout.qml +++ b/modules/Wlogout.qml @@ -1,5 +1,4 @@ import QtQuick -import Quickshell import "." as M M.BarIcon { @@ -10,10 +9,6 @@ M.BarIcon { required property var bar - Process { - id: runner - } - MouseArea { anchors.fill: parent cursorShape: Qt.PointingHandCursor @@ -27,10 +22,6 @@ M.BarIcon { screen: root.bar.screen anchorX: root.mapToGlobal(root.width / 2, 0).x - (QsWindow.window?.screen?.x ?? 0) onMenuClosed: menuLoader.active = false - onRunCommand: cmd => { - runner.command = cmd; - runner.running = true; - } } } }