forked from Shinonome/dots-hyprland
no more hacky focus grab thanks to hyprland's dfb841c303263208c2f8ac7a55fbdf4668594fb7
This commit is contained in:
@@ -22,7 +22,6 @@ Scope { // Scope
|
||||
sourceComponent: PanelWindow { // Window
|
||||
id: cheatsheetRoot
|
||||
visible: cheatsheetLoader.active
|
||||
focusable: true
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
@@ -49,28 +48,12 @@ Scope { // Scope
|
||||
HyprlandFocusGrab { // Click outside to close
|
||||
id: grab
|
||||
windows: [ cheatsheetRoot ]
|
||||
active: false
|
||||
active: cheatsheetRoot.visible
|
||||
onCleared: () => {
|
||||
if (!active) cheatsheetRoot.hide()
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: cheatsheetRoot
|
||||
function onVisibleChanged() {
|
||||
delayedGrabTimer.start()
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: delayedGrabTimer
|
||||
interval: ConfigOptions.hacks.arbitraryRaceConditionDelay
|
||||
repeat: false
|
||||
onTriggered: {
|
||||
grab.active = cheatsheetRoot.visible
|
||||
}
|
||||
}
|
||||
|
||||
// Background
|
||||
Rectangle {
|
||||
id: cheatsheetBackground
|
||||
|
||||
Reference in New Issue
Block a user