1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

hyprland: always use single window

This commit is contained in:
bbedward
2026-01-09 09:57:31 -05:00
parent 0f09cc693a
commit 6a109274f8
2 changed files with 25 additions and 8 deletions

View File

@@ -49,7 +49,7 @@ Item {
readonly property alias clickCatcher: clickCatcher
readonly property bool useHyprlandFocusGrab: CompositorService.useHyprlandFocusGrab
readonly property bool useBackground: showBackground && SettingsData.modalDarkenBackground
readonly property bool useSingleWindow: useHyprlandFocusGrab || useBackground
readonly property bool useSingleWindow: CompositorService.isHyprland || useBackground
signal opened
signal dialogClosed

View File

@@ -96,7 +96,7 @@ Item {
setBarContext(pos, bottomGap);
}
readonly property bool useBackgroundWindow: true
readonly property bool useBackgroundWindow: !CompositorService.isHyprland || CompositorService.useHyprlandFocusGrab
function open() {
if (!screen)
@@ -304,20 +304,37 @@ Item {
anchors {
left: true
top: true
right: !useBackgroundWindow
bottom: !useBackgroundWindow
}
WlrLayershell.margins {
left: root.alignedX - shadowBuffer
top: root.alignedY - shadowBuffer
left: useBackgroundWindow ? (root.alignedX - shadowBuffer) : 0
top: useBackgroundWindow ? (root.alignedY - shadowBuffer) : 0
}
implicitWidth: root.alignedWidth + (shadowBuffer * 2)
implicitHeight: root.alignedHeight + (shadowBuffer * 2)
implicitWidth: useBackgroundWindow ? (root.alignedWidth + (shadowBuffer * 2)) : 0
implicitHeight: useBackgroundWindow ? (root.alignedHeight + (shadowBuffer * 2)) : 0
MouseArea {
anchors.fill: parent
enabled: !useBackgroundWindow && shouldBeVisible && backgroundInteractive
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
z: -1
onClicked: mouse => {
const clickX = mouse.x;
const clickY = mouse.y;
const outsideContent = clickX < root.alignedX || clickX > root.alignedX + root.alignedWidth || clickY < root.alignedY || clickY > root.alignedY + root.alignedHeight;
if (!outsideContent)
return;
backgroundClicked();
}
}
Item {
id: contentContainer
x: shadowBuffer
y: shadowBuffer
x: useBackgroundWindow ? shadowBuffer : root.alignedX
y: useBackgroundWindow ? shadowBuffer : root.alignedY
width: root.alignedWidth
height: root.alignedHeight