From 5aa34b898c7116aa54a3e7efac82790b6c75f123 Mon Sep 17 00:00:00 2001 From: Vantesh <121645908+Vantesh@users.noreply.github.com> Date: Wed, 27 Aug 2025 00:51:33 +0300 Subject: [PATCH 1/2] feat: implement uwsm session check on logout --- Services/CompositorService.qml | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/Services/CompositorService.qml b/Services/CompositorService.qml index 7856dc34..601b1662 100644 --- a/Services/CompositorService.qml +++ b/Services/CompositorService.qml @@ -187,10 +187,33 @@ Singleton { } function logout() { - if (isNiri) { - NiriService.quit() - return + // Trigger the check process + uwsmCheck.running = true + } + + Process { + id: uwsmCheck + // `uwsm check is-active` returns 0 if in uwsm-managed session, 1 otherwise + command: ["uwsm", "check", "is-active"] + running: false + onExited: function(exitCode) { + if (exitCode === 0) { + uwsmStop.running = true + return + } + + // Not a uwsm-managed session; fall back to compositor-specific logout + if (isNiri) { + NiriService.quit() + return + } + Hyprland.dispatch("exit") } - Hyprland.dispatch("exit") + } + + Process { + id: uwsmStop + command: ["uwsm", "stop"] + running: false } } From 4ca64a85bc3dfe12cbe662b9b3999b8844737975 Mon Sep 17 00:00:00 2001 From: Vantesh <121645908+Vantesh@users.noreply.github.com> Date: Wed, 27 Aug 2025 02:34:46 +0300 Subject: [PATCH 2/2] feat:implement uwsm session check --- Services/CompositorService.qml | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/Services/CompositorService.qml b/Services/CompositorService.qml index 601b1662..6ec06184 100644 --- a/Services/CompositorService.qml +++ b/Services/CompositorService.qml @@ -13,6 +13,7 @@ Singleton { // Compositor detection property bool isHyprland: false property bool isNiri: false + property bool uwsmActive: false property string compositor: "unknown" readonly property string hyprlandSignature: Quickshell.env("HYPRLAND_INSTANCE_SIGNATURE") @@ -80,6 +81,7 @@ Singleton { Component.onCompleted: { detectCompositor() + uwsmCheck.running = true } function filterCurrentWorkspace(toplevels, screen){ @@ -187,8 +189,18 @@ Singleton { } function logout() { - // Trigger the check process - uwsmCheck.running = true + if (uwsmActive) { + Quickshell.execDetached(["uwsm", "stop"]) + return + } + + if (isNiri) { + NiriService.quit() + return + } + + // Hyprland fallback + Hyprland.dispatch("exit") } Process { @@ -197,23 +209,7 @@ Singleton { command: ["uwsm", "check", "is-active"] running: false onExited: function(exitCode) { - if (exitCode === 0) { - uwsmStop.running = true - return - } - - // Not a uwsm-managed session; fall back to compositor-specific logout - if (isNiri) { - NiriService.quit() - return - } - Hyprland.dispatch("exit") + uwsmActive = exitCode === 0 } } - - Process { - id: uwsmStop - command: ["uwsm", "stop"] - running: false - } }