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
This commit is contained in:
Yifan Zhu 2024-04-11 09:31:03 -07:00
parent bf4c5241a0
commit 1a4606d990

View file

@ -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;
}
}