overview: no cursor warp for click-to-focus, add ws focus

This commit is contained in:
end-4
2025-04-24 10:01:26 +02:00
parent e612abad23
commit 700b126a9e
2 changed files with 18 additions and 4 deletions
@@ -5,6 +5,7 @@ import Qt5Compat.GraphicalEffects
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell import Quickshell
import Quickshell.Io
import Quickshell.Widgets import Quickshell.Widgets
import Quickshell.Wayland import Quickshell.Wayland
import Quickshell.Hyprland import Quickshell.Hyprland
@@ -32,9 +33,10 @@ Item {
property Component windowComponent: OverviewWindow {} property Component windowComponent: OverviewWindow {}
property list<OverviewWindow> windowWidgets: [] property list<OverviewWindow> windowWidgets: []
// onWindowsChanged: { Process {
// console.log("Windows changed") id: closeOverview
// } command: ["bash", "-c", "qs ipc call overview close &"] // Somehow has to by async to work?
}
Rectangle { Rectangle {
id: overviewBackground id: overviewBackground
@@ -69,6 +71,15 @@ Item {
color: Appearance.colors.colLayer1 // TODO: reconsider this color for a cleaner look color: Appearance.colors.colLayer1 // TODO: reconsider this color for a cleaner look
radius: Appearance.rounding.screenRounding * root.scale radius: Appearance.rounding.screenRounding * root.scale
MouseArea {
id: mouseArea
anchors.fill: parent
onClicked: (event) => {
closeOverview.running = true
Hyprland.dispatch(`workspace ${workspace.workspaceValue}`)
}
}
StyledText { StyledText {
z: 9999 z: 9999
anchors.left: parent.left anchors.left: parent.left
@@ -80,10 +80,13 @@ Rectangle { // Window
onExited: root.hovered = false onExited: root.hovered = false
onPressed: root.pressed = true onPressed: root.pressed = true
onReleased: root.pressed = false onReleased: root.pressed = false
onClicked: { onClicked: (event) => {
if (windowData) { if (windowData) {
closeOverview.running = true closeOverview.running = true
Hyprland.dispatch(`keyword cursor:no_warps true`)
Hyprland.dispatch(`focuswindow address:${windowData.address}`) Hyprland.dispatch(`focuswindow address:${windowData.address}`)
Hyprland.dispatch(`keyword cursor:no_warps false`)
event.accepted = true
} }
} }
} }