fix overview toggle mouse hog

This commit is contained in:
end-4
2025-05-11 12:05:08 +02:00
parent 9ce4795266
commit b91dde50af
@@ -19,6 +19,8 @@ Scope {
id: root
property var modelData
property string searchingText: ""
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(root.screen)
property bool monitorIsFocused: (Hyprland.focusedMonitor.id == monitor.id)
screen: modelData
// visible: GlobalStates.overviewOpen
visible: true
@@ -42,12 +44,30 @@ Scope {
HyprlandFocusGrab {
id: grab
windows: [ root ]
active: GlobalStates.overviewOpen
property bool canBeActive: root.monitorIsFocused
active: false
onCleared: () => {
if (!active) GlobalStates.overviewOpen = false
}
}
Connections {
target: GlobalStates
function onOverviewOpenChanged() {
delayedGrabTimer.start()
}
}
Timer {
id: delayedGrabTimer
interval: ConfigOptions.hacks.arbitraryRaceConditionDelay
repeat: false
onTriggered: {
if (!grab.canBeActive) return
grab.active = GlobalStates.overviewOpen
}
}
width: columnLayout.width
height: columnLayout.height