Bug 493735 - Closing the only window on one screen does not focus another window on another screen
Summary: Closing the only window on one screen does not focus another window on anothe...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (show other bugs)
Version: 6.1.90
Platform: Fedora RPMs Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen, regression, usability
Depends on:
Blocks:
 
Reported: 2024-09-27 14:49 UTC by Tomasz Hołubowicz
Modified: 2024-10-10 14:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Hołubowicz 2024-09-27 14:49:54 UTC
SUMMARY
If you have one window per screen (at least two screens) and you close one of them then the other window should be automatically focused (at least this is how it works for a single screen).

STEPS TO REPRODUCE
1. Have one window on one screen and another window on another screen.
2. Close one window.

OBSERVED RESULT
Nothing gets focused. If I start writing something then krunner shows ("Activate when pressing any key on the desktop" setting), but it shows on another screen (not the one where window was closed) which seems like a weird choice.

EXPECTED RESULT
Either another available window should get focused (in this situation the one on another screen) or krunner should be displayed on a screen which was focused most recently. 

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 41
KDE Plasma Version: 6.1.90
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2
Kernel Version: 6.11.0-63.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Comment 1 Nate Graham 2024-09-27 18:19:10 UTC
Was this part intentional, Xaver? Or an unintentional quirk of the intentional changes?
Comment 2 Zamundaaa 2024-10-04 14:21:09 UTC
(In reply to Tomasz Hołubowicz from comment #0)
> If you have one window per screen (at least two screens) and you close one
> of them then the other window should be automatically focused (at least this
> is how it works for a single screen).
Not anymore, focus was intentionally changed to be per screen. You can switch it back in the window behavior -> focus settings

> Nothing gets focused. If I start writing something then krunner shows ("Activate when pressing any key on the desktop" setting), but it shows on another screen (not the one where window was closed) which seems like a weird choice.
Yeah, that's not supposed to happen.
Comment 3 Vlad Zahorodnii 2024-10-10 13:44:45 UTC
Git commit 47a2a2e12a52d1c28ba1043071190c9707640bee by Vlad Zahorodnii.
Committed on 09/10/2024 at 21:18.
Pushed by vladz into branch 'master'.

Prefer activating desktop window on active output

Workspace::findDesktop() doesn't take into account the current active
output, and instead returns the first top desktop window found in the
stack. This means that the active output may drift and the focus chain
logic can break.
Related: bug 494332

M  +5    -4    src/activation.cpp
M  +3    -3    src/layers.cpp
M  +5    -5    src/workspace.cpp
M  +1    -1    src/workspace.h

https://invent.kde.org/plasma/kwin/-/commit/47a2a2e12a52d1c28ba1043071190c9707640bee
Comment 4 Vlad Zahorodnii 2024-10-10 14:28:33 UTC
Git commit 72d64a3b96f1fb7111852f876de2bb68aa7645f5 by Vlad Zahorodnii.
Committed on 10/10/2024 at 13:45.
Pushed by vladz into branch 'Plasma/6.2'.

Prefer activating desktop window on active output

Workspace::findDesktop() doesn't take into account the current active
output, and instead returns the first top desktop window found in the
stack. This means that the active output may drift and the focus chain
logic can break.
Related: bug 494332
(cherry picked from commit 47a2a2e12a52d1c28ba1043071190c9707640bee)

M  +5    -4    src/activation.cpp
M  +3    -3    src/layers.cpp
M  +5    -5    src/workspace.cpp
M  +1    -1    src/workspace.h

https://invent.kde.org/plasma/kwin/-/commit/72d64a3b96f1fb7111852f876de2bb68aa7645f5