From 0ad67298fc3118d03d9faefcdb7d077fe232fbd9 Mon Sep 17 00:00:00 2001 From: Adam0 Date: Fri, 14 Aug 2026 13:36:26 -0400 Subject: [PATCH] Streamline overview update handling Flush complete Hyprland refreshes directly when the overview opens and only calculate drop coordinates when a tiled-window swap is required. --- modules/overview/OverviewWidget.qml | 14 ++++++++++---- services/HyprlandData.qml | 12 +++++++----- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/modules/overview/OverviewWidget.qml b/modules/overview/OverviewWidget.qml index 9727ff7..114af26 100644 --- a/modules/overview/OverviewWidget.qml +++ b/modules/overview/OverviewWidget.qml @@ -379,10 +379,16 @@ Item { onReleased: { const targetWorkspace = root.draggingTargetWorkspace; const address = window.windowData?.address; - const dropX = window.x + window.Drag.hotSpot.x; - const dropY = window.y + window.Drag.hotSpot.y; - const cursorPosition = windowSpace.mapToGlobal(dropX, dropY); - const swapTarget = !windowData?.floating ? root.dropSwapTarget(targetWorkspace, dropX, dropY, address) : ""; + let swapTarget = ""; + let cursorPosition = null; + if (targetWorkspace !== -1) { + const dropX = window.x + window.Drag.hotSpot.x; + const dropY = window.y + window.Drag.hotSpot.y; + swapTarget = !windowData?.floating ? root.dropSwapTarget(targetWorkspace, dropX, dropY, address) : ""; + if (swapTarget) + cursorPosition = windowSpace.mapToGlobal(dropX, dropY); + } + window.pressed = false; window.Drag.active = false; root.draggingFromWorkspace = -1; diff --git a/services/HyprlandData.qml b/services/HyprlandData.qml index fdf167f..56aeadf 100644 --- a/services/HyprlandData.qml +++ b/services/HyprlandData.qml @@ -27,7 +27,12 @@ Singleton { } function updateAll() { - scheduleUpdates(true, true); + if (!GlobalStates.overviewOpen) + return; + + pendingWindowsUpdate = true; + pendingMonitorsUpdate = true; + flushPendingUpdates(); } function scheduleUpdates(windows, monitors) { @@ -67,10 +72,8 @@ Singleton { } Component.onCompleted: { - if (GlobalStates.overviewOpen) { + if (GlobalStates.overviewOpen) root.updateAll(); - root.flushPendingUpdates(); - } } Connections { @@ -79,7 +82,6 @@ Singleton { function onOverviewOpenChanged() { if (GlobalStates.overviewOpen) { root.updateAll(); - root.flushPendingUpdates(); } else { eventDebounceTimer.stop(); root.pendingWindowsUpdate = false; -- 2.51.2