make overview show only on focused monitor (fixes #2782)

This commit is contained in:
end-4
2026-01-01 09:26:43 +01:00
parent af1adef5f1
commit 575b26d572
2 changed files with 97 additions and 102 deletions
@@ -14,16 +14,12 @@ import Quickshell.Hyprland
Scope { Scope {
id: overviewScope id: overviewScope
property bool dontAutoCancelSearch: false property bool dontAutoCancelSearch: false
Variants {
id: overviewVariants
model: Quickshell.screens
PanelWindow { PanelWindow {
id: root id: root
required property var modelData
property string searchingText: "" property string searchingText: ""
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(root.screen) readonly property HyprlandMonitor monitor: Hyprland.monitorFor(root.screen)
property bool monitorIsFocused: (Hyprland.focusedMonitor?.id == monitor?.id) property bool monitorIsFocused: (Hyprland.focusedMonitor?.id == monitor?.id)
screen: modelData
visible: GlobalStates.overviewOpen visible: GlobalStates.overviewOpen
WlrLayershell.namespace: "quickshell:overview" WlrLayershell.namespace: "quickshell:overview"
@@ -121,13 +117,12 @@ Scope {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
active: GlobalStates.overviewOpen && (Config?.options.overview.enable ?? true) active: GlobalStates.overviewOpen && (Config?.options.overview.enable ?? true)
sourceComponent: OverviewWidget { sourceComponent: OverviewWidget {
panelWindow: root screen: root.screen
visible: (root.searchingText == "") visible: (root.searchingText == "")
} }
} }
} }
} }
}
function toggleClipboard() { function toggleClipboard() {
if (GlobalStates.overviewOpen && overviewScope.dontAutoCancelSearch) { if (GlobalStates.overviewOpen && overviewScope.dontAutoCancelSearch) {
@@ -13,8 +13,8 @@ import Quickshell.Hyprland
Item { Item {
id: root id: root
required property var panelWindow required property var screen
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(panelWindow.screen) readonly property HyprlandMonitor monitor: Hyprland.monitorFor(screen)
readonly property var toplevels: ToplevelManager.toplevels readonly property var toplevels: ToplevelManager.toplevels
readonly property int workspacesShown: Config.options.overview.rows * Config.options.overview.columns readonly property int workspacesShown: Config.options.overview.rows * Config.options.overview.columns
readonly property int workspaceGroup: Math.floor((monitor.activeWorkspace?.id - 1) / workspacesShown) readonly property int workspaceGroup: Math.floor((monitor.activeWorkspace?.id - 1) / workspacesShown)