From 60b2225cc65ba735014ce1ccd0f8ab0d2d0d424f Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Mon, 15 Dec 2025 00:31:10 +0100 Subject: [PATCH] waffles: taskview: esc to close --- .../modules/waffle/taskView/WaffleTaskView.qml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/dots/.config/quickshell/ii/modules/waffle/taskView/WaffleTaskView.qml b/dots/.config/quickshell/ii/modules/waffle/taskView/WaffleTaskView.qml index fc145f221..05a2ccf40 100644 --- a/dots/.config/quickshell/ii/modules/waffle/taskView/WaffleTaskView.qml +++ b/dots/.config/quickshell/ii/modules/waffle/taskView/WaffleTaskView.qml @@ -40,7 +40,7 @@ Scope { WlrLayershell.namespace: "quickshell:wTaskView" WlrLayershell.layer: WlrLayer.Overlay - // WlrLayershell.keyboardFocus: GlobalStates.overviewOpen ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None + WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand color: "transparent" anchors { @@ -54,13 +54,23 @@ Scope { id: taskViewContent anchors.fill: parent + Component.onCompleted: { + taskViewContent.forceActiveFocus(); + } + Keys.onPressed: event => { + if (event.key === Qt.Key_Escape) { + GlobalStates.overviewOpen = false; + } + } + Connections { target: GlobalStates function onOverviewOpenChanged() { - if (!GlobalStates.overviewOpen) taskViewContent.close(); + if (!GlobalStates.overviewOpen) + taskViewContent.close(); } } - onClosed: panelLoader.active = false; + onClosed: panelLoader.active = false } } }