summaryrefslogtreecommitdiff
path: root/modules/drawers/Drawers.qml
diff options
context:
space:
mode:
Diffstat (limited to 'modules/drawers/Drawers.qml')
-rw-r--r--modules/drawers/Drawers.qml39
1 files changed, 22 insertions, 17 deletions
diff --git a/modules/drawers/Drawers.qml b/modules/drawers/Drawers.qml
index 4c795a5..4ade8c4 100644
--- a/modules/drawers/Drawers.qml
+++ b/modules/drawers/Drawers.qml
@@ -28,6 +28,20 @@ Variants {
id: win
readonly property bool hasFullscreen: Hypr.monitorFor(screen)?.activeWorkspace?.toplevels.values.some(t => t.lastIpcObject.fullscreen === 2) ?? false
+ readonly property int dragMaskPadding: {
+ if (focusGrab.active || panels.popouts.isDetached)
+ return 0;
+
+ const mon = Hypr.monitorFor(screen);
+ if (mon?.lastIpcObject.specialWorkspace.name || mon?.activeWorkspace?.lastIpcObject.windows > 0)
+ return 0;
+
+ const thresholds = [];
+ for (const panel of ["dashboard", "launcher", "session", "sidebar"])
+ if (Config[panel].enabled)
+ thresholds.push(Config[panel].dragThreshold);
+ return Math.max(...thresholds);
+ }
onHasFullscreenChanged: {
visibilities.launcher = false;
@@ -40,11 +54,14 @@ Variants {
WlrLayershell.exclusionMode: ExclusionMode.Ignore
WlrLayershell.keyboardFocus: visibilities.launcher || visibilities.session ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
- mask: {
- if (focusGrab.active || panels.popouts.isDetached)
- return inputMask;
- const mon = Hypr.monitorFor(screen);
- return mon?.lastIpcObject.specialWorkspace.name || mon?.activeWorkspace?.lastIpcObject.windows > 0 ? inputMask : null;
+ mask: Region {
+ x: bar.implicitWidth + win.dragMaskPadding
+ y: Config.border.thickness + win.dragMaskPadding
+ width: win.width - bar.implicitWidth - Config.border.thickness - win.dragMaskPadding * 2
+ height: win.height - Config.border.thickness * 2 - win.dragMaskPadding * 2
+ intersection: Intersection.Xor
+
+ regions: regions.instances
}
anchors.top: true
@@ -52,18 +69,6 @@ Variants {
anchors.left: true
anchors.right: true
- Region {
- id: inputMask
-
- x: bar.implicitWidth
- y: Config.border.thickness
- width: win.width - bar.implicitWidth - Config.border.thickness
- height: win.height - Config.border.thickness * 2
- intersection: Intersection.Xor
-
- regions: regions.instances
- }
-
Variants {
id: regions