1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 07:52:50 -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 alias clickCatcher: clickCatcher
readonly property bool useHyprlandFocusGrab: CompositorService.useHyprlandFocusGrab readonly property bool useHyprlandFocusGrab: CompositorService.useHyprlandFocusGrab
readonly property bool useBackground: showBackground && SettingsData.modalDarkenBackground readonly property bool useBackground: showBackground && SettingsData.modalDarkenBackground
readonly property bool useSingleWindow: useHyprlandFocusGrab || useBackground readonly property bool useSingleWindow: CompositorService.isHyprland || useBackground
signal opened signal opened
signal dialogClosed signal dialogClosed

View File

@@ -96,7 +96,7 @@ Item {
setBarContext(pos, bottomGap); setBarContext(pos, bottomGap);
} }
readonly property bool useBackgroundWindow: true readonly property bool useBackgroundWindow: !CompositorService.isHyprland || CompositorService.useHyprlandFocusGrab
function open() { function open() {
if (!screen) if (!screen)
@@ -304,20 +304,37 @@ Item {
anchors { anchors {
left: true left: true
top: true top: true
right: !useBackgroundWindow
bottom: !useBackgroundWindow
} }
WlrLayershell.margins { WlrLayershell.margins {
left: root.alignedX - shadowBuffer left: useBackgroundWindow ? (root.alignedX - shadowBuffer) : 0
top: root.alignedY - shadowBuffer top: useBackgroundWindow ? (root.alignedY - shadowBuffer) : 0
} }
implicitWidth: root.alignedWidth + (shadowBuffer * 2) implicitWidth: useBackgroundWindow ? (root.alignedWidth + (shadowBuffer * 2)) : 0
implicitHeight: root.alignedHeight + (shadowBuffer * 2) 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 { Item {
id: contentContainer id: contentContainer
x: shadowBuffer x: useBackgroundWindow ? shadowBuffer : root.alignedX
y: shadowBuffer y: useBackgroundWindow ? shadowBuffer : root.alignedY
width: root.alignedWidth width: root.alignedWidth
height: root.alignedHeight height: root.alignedHeight