aboutsummaryrefslogtreecommitdiffstats
path: root/config/quickshell/modules
diff options
context:
space:
mode:
authorKiran George <kirangeorge1995@gmail.com>2025-08-09 16:28:51 +0530
committerKiran George <kirangeorge1995@gmail.com>2025-08-09 16:28:51 +0530
commit17dafd3586db4db77801dc72788b60934b43f966 (patch)
treed5fb841d38d63c21d32b6a70f6d69b4f11e2c901 /config/quickshell/modules
parent700b054c6f884cb9510e29f993080c0f7b109fd0 (diff)
Overview multimonitor fix
Diffstat (limited to 'config/quickshell/modules')
-rw-r--r--config/quickshell/modules/common/ConfigOptions.qml1
-rw-r--r--config/quickshell/modules/overview/Overview.qml2
-rw-r--r--config/quickshell/modules/overview/OverviewWidget.qml40
-rw-r--r--config/quickshell/modules/overview/OverviewWindow.qml27
4 files changed, 61 insertions, 9 deletions
diff --git a/config/quickshell/modules/common/ConfigOptions.qml b/config/quickshell/modules/common/ConfigOptions.qml
index 25f0de05..d1eb7499 100644
--- a/config/quickshell/modules/common/ConfigOptions.qml
+++ b/config/quickshell/modules/common/ConfigOptions.qml
@@ -17,6 +17,7 @@ Singleton {
property real windowPadding: 6
property real position: 1 // 0: top | 1: middle | 2: bottom
property real workspaceNumberSize: 120 // Set 0, dynamic calculation based on monitor size
+ property bool showAllMonitors: false // Show windows from all monitors
}
property QtObject resources: QtObject {
diff --git a/config/quickshell/modules/overview/Overview.qml b/config/quickshell/modules/overview/Overview.qml
index ef5a49c3..08a3b0d3 100644
--- a/config/quickshell/modules/overview/Overview.qml
+++ b/config/quickshell/modules/overview/Overview.qml
@@ -17,7 +17,7 @@ Scope {
Variants {
id: overviewVariants
- model: Quickshell.screens
+ model: Quickshell.screens.filter(s => Hyprland.monitorFor(s).id === Hyprland.focusedMonitor?.id)
PanelWindow {
id: root
required property var modelData
diff --git a/config/quickshell/modules/overview/OverviewWidget.qml b/config/quickshell/modules/overview/OverviewWidget.qml
index 93e90967..05a15e10 100644
--- a/config/quickshell/modules/overview/OverviewWidget.qml
+++ b/config/quickshell/modules/overview/OverviewWidget.qml
@@ -46,6 +46,33 @@ Item {
property int draggingFromWorkspace: -1
property int draggingTargetWorkspace: -1
+ // Debug logging function
+ function debugMultiMonitorInfo() {
+ console.log("=== Multi-Monitor Debug Info ===")
+ console.log("Current monitor ID:", root.monitor.id)
+ console.log("Current monitor name:", root.monitor.name)
+ console.log("Current monitor scale:", root.monitor.scale)
+ console.log("Current monitor position:", root.monitor.x, root.monitor.y)
+ console.log("Total monitors:", HyprlandData.monitors.length)
+
+ HyprlandData.monitors.forEach((mon, idx) => {
+ console.log(`Monitor ${idx}: ID=${mon.id}, Name=${mon.name}, Scale=${mon.scale}, Pos=(${mon.x},${mon.y}), Size=${mon.width}x${mon.height}, Reserved=[${mon.reserved.join(",")}]`)
+ })
+
+ console.log("Total windows:", windowAddresses.length)
+ windowAddresses.forEach((address, idx) => {
+ const win = windowByAddress[address]
+ if (win) {
+ console.log(`Window ${idx}: ${win.class} on monitor ${win.monitor}, workspace ${win.workspace?.id}, pos=(${win.at[0]},${win.at[1]})`)
+ }
+ })
+ console.log("=== End Debug Info ===")
+ }
+
+ Component.onCompleted: {
+ debugMultiMonitorInfo()
+ }
+
implicitWidth: overviewBackground.implicitWidth + Appearance.sizes.elevationMargin * 2
implicitHeight: overviewBackground.implicitHeight + Appearance.sizes.elevationMargin * 2
@@ -233,14 +260,21 @@ Item {
model: ScriptModel {
values: windowAddresses.filter((address) => {
var win = windowByAddress[address]
- return (root.workspaceGroup * root.workspacesShown < win?.workspace?.id && win?.workspace?.id <= (root.workspaceGroup + 1) * root.workspacesShown)
+ if (!win) return false
+
+ // Filter by workspace group AND monitor if configured
+ const inWorkspaceGroup = (root.workspaceGroup * root.workspacesShown < win?.workspace?.id &&
+ win?.workspace?.id <= (root.workspaceGroup + 1) * root.workspacesShown)
+ const inMonitor = ConfigOptions.overview.showAllMonitors || win.monitor === root.monitor.id
+
+ return inWorkspaceGroup && inMonitor
})
}
delegate: OverviewWindow {
id: window
windowData: windowByAddress[modelData]
- monitorData: HyprlandData.monitors.find(m => m.id === windowData?.monitor) // use monitorData of the monitor the window is on
- scale: root.scale * (monitorData?.scale / root.monitor?.scale) // adjust window scale to the monitor where the overview is displayed
+ monitorData: root.monitorData
+ scale: root.scale
availableWorkspaceWidth: root.workspaceImplicitWidth
availableWorkspaceHeight: root.workspaceImplicitHeight
diff --git a/config/quickshell/modules/overview/OverviewWindow.qml b/config/quickshell/modules/overview/OverviewWindow.qml
index 93ea06f9..b28a5bf6 100644
--- a/config/quickshell/modules/overview/OverviewWindow.qml
+++ b/config/quickshell/modules/overview/OverviewWindow.qml
@@ -17,14 +17,31 @@ Rectangle { // Window
property var scale
property var availableWorkspaceWidth
property var availableWorkspaceHeight
- property bool restrictToWorkspace: true
- property real initX: Math.max((windowData?.at[0] - monitorData?.reserved[0] - monitorData?.x) * root.scale, 0) + xOffset
- property real initY: Math.max((windowData?.at[1] - monitorData?.reserved[1] - monitorData?.y) * root.scale, 0) + yOffset
+ property bool restrictToWorkspace: true``
+ property var sourceMonitor: HyprlandData.monitors.find(m => m.id === windowData?.monitor) || HyprlandData.monitors[0] || { scale: 1.0, x: 0, y: 0, reserved: [0,0,0,0] }
+ property real monitorScaleFactor: sourceMonitor?.scale || 1.0
+ property real targetScaleFactor: monitorData?.scale || monitorScaleFactor || 1.0
+ property var focusedMonitor: Hyprland.focusedMonitor
+ property real focusedMonitorScale: focusedMonitor?.scale || 1.0
+ property real effectiveScale: root.scale * (
+ ConfigOptions.overview.showAllMonitors
+ ? (focusedMonitorScale / monitorScaleFactor) // Scale relative to focused monitor when showing all
+ : (targetScaleFactor / monitorScaleFactor) // Scale relative to target monitor normally
+ )
+
+ // Calculate position relative to source monitor
+ property real relativeX: (windowData?.at[0] - sourceMonitor?.x - sourceMonitor?.reserved[0]) || 0
+ property real relativeY: (windowData?.at[1] - sourceMonitor?.y - sourceMonitor?.reserved[1]) || 0
+
+ // Scale position based on monitor differences
+ property real initX: Math.max(relativeX * effectiveScale, 0) + xOffset
+ property real initY: Math.max(relativeY * effectiveScale, 0) + yOffset
property real xOffset: 0
property real yOffset: 0
- property var targetWindowWidth: windowData?.size[0] * scale
- property var targetWindowHeight: windowData?.size[1] * scale
+ // Scale window size based on monitor differences
+ property var targetWindowWidth: (windowData?.size[0] || 0) * effectiveScale
+ property var targetWindowHeight: (windowData?.size[1] || 0) * effectiveScale
property bool hovered: false
property bool pressed: false
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage