From 1a4606d990b89f403e048edef4b07b407b94a370 Mon Sep 17 00:00:00 2001 From: Yifan Zhu Date: Thu, 11 Apr 2024 09:31:03 -0700 Subject: [PATCH] scripting/windowmodel: match screen closest to center for filter When filtering windows by screen, match the screen closest to the window center, instead of testing whether the window is visible on the current screen. The new method guarantees that when filtering by screen, the window appears for exactly one screen. Previously windows spanning multiple screens appear on all of them, and off-screen windows are not shown in any screen. BUG: 480028 BUG: 485337 FIXED-IN: 6.0.4 --- src/scripting/windowmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripting/windowmodel.cpp b/src/scripting/windowmodel.cpp index a3b097506f..f6730cbc89 100644 --- a/src/scripting/windowmodel.cpp +++ b/src/scripting/windowmodel.cpp @@ -275,7 +275,7 @@ bool WindowFilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourc } if (m_output) { - if (!window->isOnOutput(m_output)) { + if (window->output() != m_output) { return false; } }