aboutsummaryrefslogtreecommitdiffstats
path: root/config/quickshell/modules/overview/OverviewWindow.qml
diff options
context:
space:
mode:
authorDonald Williams <129223418+dwilliam62@users.noreply.github.com>2025-10-05 11:18:33 -0400
committerGitHub <noreply@github.com>2025-10-05 11:18:33 -0400
commit0c5e7e9de06cc7e786974a3ee5b8e7bda517d219 (patch)
treea5d7357d669e0fc69c0e05bd2b431a51446f104b /config/quickshell/modules/overview/OverviewWindow.qml
parent613b232adb2f26b0bc89464a5003271a8559e6f0 (diff)
parent8da32f1f6e8ec1d2b25a14efbf927af232323315 (diff)
Merge pull request #797 from SherLock707/qs_overview_fix_v2
Overview multimonitor fix Test with laptop and external display
Diffstat (limited to 'config/quickshell/modules/overview/OverviewWindow.qml')
-rw-r--r--config/quickshell/modules/overview/OverviewWindow.qml27
1 files changed, 22 insertions, 5 deletions
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