1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-06 05:28:29 -04:00

fix(Hover): refactor & update hover tracking w/context menus

Fixes #2737
This commit is contained in:
purian23
2026-07-04 00:08:58 -04:00
parent 2861cc89c6
commit c554d973ef
30 changed files with 297 additions and 27 deletions
@@ -35,6 +35,10 @@ Item {
property real _frozenMotionX: 0
property real _frozenMotionY: 0
TransientSurfaceTracker {
id: transientSurfaces
}
readonly property bool useHyprlandFocusGrab: CompositorService.useHyprlandFocusGrab
readonly property var effectiveScreen: contentWindow.screen
readonly property real screenWidth: effectiveScreen?.width ?? 1920
@@ -499,10 +503,18 @@ Item {
}
// Handles hover dismissal grace periods for edge-hover sessions w/cursor
readonly property bool _edgeRetractEnabled: (modalHandle && modalHandle.edgeHoverManaged === true) && spotlightOpen && !isClosing
readonly property bool _edgeRetractEnabled: (modalHandle && modalHandle.edgeHoverManaged === true) && spotlightOpen && !isClosing && !transientSurfaces.active
property bool _edgeBodyHover: false
property bool _edgeArmed: false
on_EdgeRetractEnabledChanged: {
if (!_edgeRetractEnabled) {
_edgeRetractGrace.stop();
} else if (_edgeArmed && !_edgeBodyHover) {
_edgeRetractGrace.restart();
}
}
Timer {
id: _edgeRetractGrace
interval: 150
@@ -534,9 +546,7 @@ Item {
HyprlandFocusGrab {
id: focusGrab
readonly property var contextMenuWindow: root.spotlightContent?.activeContextMenu?.contextWindow ?? null
readonly property bool contextMenuActive: root.spotlightContent?.activeContextMenu?.renderActive ?? false
windows: contextMenuActive && contextMenuWindow ? [contentWindow, contextMenuWindow] : [contentWindow]
windows: [contentWindow].concat(transientSurfaces.focusWindows)
active: root.useHyprlandFocusGrab && root.spotlightOpen
onCleared: {
@@ -869,6 +879,7 @@ Item {
sourceComponent: LauncherContent {
focus: true
parentModal: root
transientSurfaceTracker: transientSurfaces
}
onLoaded: {