internal: centralise focus grabs
Except detached popouts focus grab (its meant to be exclusive to the other grab)
This commit is contained in:
parent
b1086c9a22
commit
e12b9ee372
4 changed files with 6 additions and 18 deletions
|
|
@ -5,7 +5,6 @@ import qs.services
|
||||||
import qs.config
|
import qs.config
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
import Quickshell.Hyprland
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
|
||||||
|
|
@ -27,12 +26,6 @@ StackView {
|
||||||
popEnter: NoAnim {}
|
popEnter: NoAnim {}
|
||||||
popExit: NoAnim {}
|
popExit: NoAnim {}
|
||||||
|
|
||||||
HyprlandFocusGrab {
|
|
||||||
active: root.depth > 1
|
|
||||||
windows: [QsWindow.window]
|
|
||||||
onCleared: root.popouts.hasCurrent = false
|
|
||||||
}
|
|
||||||
|
|
||||||
component NoAnim: Transition {
|
component NoAnim: Transition {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: 0
|
duration: 0
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import qs.config
|
||||||
import qs.utils
|
import qs.utils
|
||||||
import Caelestia
|
import Caelestia
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Hyprland
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
@ -77,12 +76,6 @@ Item {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
HyprlandFocusGrab {
|
|
||||||
active: !Config.dashboard.showOnHover && root.visibilities.dashboard && Config.dashboard.enabled
|
|
||||||
windows: [QsWindow.window]
|
|
||||||
onCleared: root.visibilities.dashboard = false
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: timer
|
id: timer
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ Variants {
|
||||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||||
WlrLayershell.keyboardFocus: visibilities.launcher || visibilities.session ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: visibilities.launcher || visibilities.session ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
||||||
|
|
||||||
mask: focusGrab.active || Hypr.focusedMonitor?.activeWorkspace?.lastIpcObject.windows > 0 ? inputMask : null
|
mask: focusGrab.active || panels.popouts.isDetached || Hypr.focusedMonitor?.activeWorkspace?.lastIpcObject.windows > 0 ? inputMask : null
|
||||||
|
|
||||||
anchors.top: true
|
anchors.top: true
|
||||||
anchors.bottom: true
|
anchors.bottom: true
|
||||||
|
|
@ -78,12 +78,14 @@ Variants {
|
||||||
HyprlandFocusGrab {
|
HyprlandFocusGrab {
|
||||||
id: focusGrab
|
id: focusGrab
|
||||||
|
|
||||||
active: (visibilities.launcher && Config.launcher.enabled) || (visibilities.session && Config.session.enabled) || (visibilities.sidebar && Config.sidebar.enabled)
|
active: (visibilities.launcher && Config.launcher.enabled) || (visibilities.session && Config.session.enabled) || (visibilities.sidebar && Config.sidebar.enabled) || (!Config.dashboard.showOnHover && visibilities.dashboard && Config.dashboard.enabled) || (panels.popouts.currentName.startsWith("traymenu") && panels.popouts.current?.depth > 1)
|
||||||
windows: [win]
|
windows: [win]
|
||||||
onCleared: {
|
onCleared: {
|
||||||
visibilities.launcher = false;
|
visibilities.launcher = false;
|
||||||
visibilities.session = false;
|
visibilities.session = false;
|
||||||
visibilities.sidebar = false;
|
visibilities.sidebar = false;
|
||||||
|
visibilities.dashboard = false;
|
||||||
|
panels.popouts.hasCurrent = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ CustomMouseArea {
|
||||||
if (!utilitiesShortcutActive)
|
if (!utilitiesShortcutActive)
|
||||||
visibilities.utilities = false;
|
visibilities.utilities = false;
|
||||||
|
|
||||||
if (!popouts.currentName.startsWith("traymenu") || popouts.current?.depth <= 1)
|
if (!popouts.currentName.startsWith("traymenu") || (popouts.current?.depth ?? 0) <= 1)
|
||||||
popouts.hasCurrent = false;
|
popouts.hasCurrent = false;
|
||||||
|
|
||||||
if (Config.bar.showOnHover)
|
if (Config.bar.showOnHover)
|
||||||
|
|
@ -199,7 +199,7 @@ CustomMouseArea {
|
||||||
// Show popouts on hover
|
// Show popouts on hover
|
||||||
if (x < bar.implicitWidth)
|
if (x < bar.implicitWidth)
|
||||||
bar.checkPopout(y);
|
bar.checkPopout(y);
|
||||||
else if (!popouts.currentName.startsWith("traymenu") && !inLeftPanel(panels.popouts, x, y))
|
else if ((!popouts.currentName.startsWith("traymenu") || (popouts.current?.depth ?? 0) <= 1) && !inLeftPanel(panels.popouts, x, y))
|
||||||
popouts.hasCurrent = false;
|
popouts.hasCurrent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue