root panel window handles focus

This commit is contained in:
Benjamin Palko 2025-09-16 15:33:41 -04:00
parent bd826c14ac
commit ed6cd2c8d5
6 changed files with 34 additions and 61 deletions

View file

@ -1,15 +1,36 @@
import qs.config
import QtQuick
import Quickshell
import Quickshell.Hyprland
import Quickshell.Wayland
PanelWindow {
id: window
required property string name
property alias background: background
required property string name
property bool canFocus: true
property bool focused: false
WlrLayershell.namespace: `lux-${name}`
WlrLayershell.layer: WlrLayer.Top
WlrLayershell.keyboardFocus: window.visible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
onVisibleChanged: {
if (!canFocus)
return;
focused = visible;
}
HyprlandFocusGrab {
active: window.focused
windows: [window]
onCleared: {
if (!window.canFocus)
return;
window.focused = false;
}
}
color: "transparent"
Rectangle {