1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 13:32:50 -05:00

modals: restore Top layer as default

- Cut a mask in the background window
- restores virt kb compat
This commit is contained in:
bbedward
2025-11-24 09:38:03 -05:00
parent 1bec20ecef
commit 6c4a9bcfb8
2 changed files with 24 additions and 16 deletions

View File

@@ -49,10 +49,7 @@ Item {
signal dialogClosed
signal backgroundClicked
readonly property bool useBackgroundWindow: {
const layerOverride = Quickshell.env("DMS_MODAL_LAYER");
return !layerOverride || layerOverride === "overlay";
}
readonly property bool useBackgroundWindow: true
function open() {
ModalManager.openModal(root);
@@ -146,6 +143,16 @@ Item {
bottom: true
}
mask: Region {
item: Rectangle {
x: root.alignedX
y: root.alignedY
width: root.shouldBeVisible ? root.alignedWidth : 0
height: root.shouldBeVisible ? root.alignedHeight : 0
}
intersection: Intersection.Xor
}
MouseArea {
anchors.fill: parent
enabled: root.closeOnBackgroundClick && root.shouldBeVisible
@@ -186,13 +193,15 @@ Item {
WlrLayershell.layer: {
switch (Quickshell.env("DMS_MODAL_LAYER")) {
case "bottom":
return WlrLayershell.Bottom;
case "top":
console.error("DankModal: 'bottom' layer is not valid for modals. Defaulting to 'top' layer.");
return WlrLayershell.Top;
case "background":
return WlrLayershell.Background;
default:
console.error("DankModal: 'background' layer is not valid for modals. Defaulting to 'top' layer.");
return WlrLayershell.Top;
case "overlay":
return WlrLayershell.Overlay;
default:
return WlrLayershell.Top;
}
}
WlrLayershell.exclusiveZone: -1

View File

@@ -91,10 +91,7 @@ Item {
setBarContext(pos, bottomGap);
}
readonly property bool useBackgroundWindow: {
const layerOverride = Quickshell.env("DMS_POPOUT_LAYER");
return !layerOverride || layerOverride === "overlay";
}
readonly property bool useBackgroundWindow: true
function open() {
if (!screen)
@@ -258,13 +255,15 @@ Item {
WlrLayershell.layer: {
switch (Quickshell.env("DMS_POPOUT_LAYER")) {
case "bottom":
return WlrLayershell.Bottom;
case "top":
console.warn("DankPopout: 'bottom' layer is not valid for popouts. Defaulting to 'top' layer.");
return WlrLayershell.Top;
case "background":
return WlrLayershell.Background;
default:
console.warn("DankPopout: 'background' layer is not valid for popouts. Defaulting to 'top' layer.");
return WlrLayershell.Top;
case "overlay":
return WlrLayershell.Overlay;
default:
return WlrLayershell.Top;
}
}
WlrLayershell.exclusiveZone: -1