From 700b126a9e81b9ae9b546ca22fbb3f9a1d406f85 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 24 Apr 2025 10:01:26 +0200 Subject: [PATCH] overview: no cursor warp for click-to-focus, add ws focus --- .../modules/overview/OverviewWidget.qml | 17 ++++++++++++++--- .../modules/overview/OverviewWindow.qml | 5 ++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.config/quickshell/modules/overview/OverviewWidget.qml b/.config/quickshell/modules/overview/OverviewWidget.qml index db63369f..17068522 100644 --- a/.config/quickshell/modules/overview/OverviewWidget.qml +++ b/.config/quickshell/modules/overview/OverviewWidget.qml @@ -5,6 +5,7 @@ import Qt5Compat.GraphicalEffects import QtQuick import QtQuick.Layouts import Quickshell +import Quickshell.Io import Quickshell.Widgets import Quickshell.Wayland import Quickshell.Hyprland @@ -32,9 +33,10 @@ Item { property Component windowComponent: OverviewWindow {} property list windowWidgets: [] - // onWindowsChanged: { - // console.log("Windows changed") - // } + Process { + id: closeOverview + command: ["bash", "-c", "qs ipc call overview close &"] // Somehow has to by async to work? + } Rectangle { id: overviewBackground @@ -69,6 +71,15 @@ Item { color: Appearance.colors.colLayer1 // TODO: reconsider this color for a cleaner look radius: Appearance.rounding.screenRounding * root.scale + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: (event) => { + closeOverview.running = true + Hyprland.dispatch(`workspace ${workspace.workspaceValue}`) + } + } + StyledText { z: 9999 anchors.left: parent.left diff --git a/.config/quickshell/modules/overview/OverviewWindow.qml b/.config/quickshell/modules/overview/OverviewWindow.qml index 9f255d7a..ce85e040 100644 --- a/.config/quickshell/modules/overview/OverviewWindow.qml +++ b/.config/quickshell/modules/overview/OverviewWindow.qml @@ -80,10 +80,13 @@ Rectangle { // Window onExited: root.hovered = false onPressed: root.pressed = true onReleased: root.pressed = false - onClicked: { + onClicked: (event) => { if (windowData) { closeOverview.running = true + Hyprland.dispatch(`keyword cursor:no_warps true`) Hyprland.dispatch(`focuswindow address:${windowData.address}`) + Hyprland.dispatch(`keyword cursor:no_warps false`) + event.accepted = true } } }