From 6bab341190ba58c58c5cd53c0605ba0e6dd1f665 Mon Sep 17 00:00:00 2001 From: zach Date: Mon, 8 Jun 2026 23:35:47 +0200 Subject: [PATCH] fix splitbutton menu popout region for clicking outside panel bounds --- Components/Menu.qml | 15 +++++++++++++++ Drawers/Windows.qml | 9 ++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Components/Menu.qml b/Components/Menu.qml index 43bdc5e..70e6cd8 100644 --- a/Components/Menu.qml +++ b/Components/Menu.qml @@ -46,6 +46,21 @@ MouseArea { } onClicked: expanded = false + onExpandedChanged: { + const win = QsWindow.window; + const contentWin = win as Windows; + if (expanded) { + contentWin.menuRegion.x = menu.x; + contentWin.menuRegion.y = menu.y; + contentWin.menuRegion.width = menu.width; + contentWin.menuRegion.height = menu.height; + } else { + contentWin.menuRegion.x = 0; + contentWin.menuRegion.y = 0; + contentWin.menuRegion.width = 0; + contentWin.menuRegion.height = 0; + } + } TransformWatcher { id: watcher diff --git a/Drawers/Windows.qml b/Drawers/Windows.qml index 4151f01..933216f 100644 --- a/Drawers/Windows.qml +++ b/Drawers/Windows.qml @@ -20,6 +20,7 @@ CustomWindow { readonly property alias bar: bar readonly property bool hasFullscreen: Hypr.monitorFor(screen)?.activeWorkspace?.toplevels.values.some(t => t.lastIpcObject.fullscreen === 2) readonly property alias interactionWrapper: interactions + readonly property alias menuRegion: menuPopoutRegion property var root: Quickshell.shellDir WlrLayershell.exclusionMode: ExclusionMode.Ignore @@ -46,12 +47,18 @@ CustomWindow { visibilities.resources = false; } + Region { + id: menuPopoutRegion + + intersection: Intersection.Subtract + } + Region { id: region height: root.height - bar.implicitHeight - Config.barConfig.border intersection: Intersection.Xor - regions: popoutRegions.instances + regions: [...popoutRegions.instances, menuPopoutRegion] width: root.width - Config.barConfig.border * 2 x: Config.barConfig.border y: bar.implicitHeight