root panel window handles focus
This commit is contained in:
parent
bd826c14ac
commit
ed6cd2c8d5
6 changed files with 34 additions and 61 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue