Bug 479388

Summary: Minimizing XWayland window doesn't activate the previous active window
Product: [Plasma] kwin Reporter: Jin Liu <ad.liu.jin>
Component: generalAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate, nicolas.fella
Priority: NOR Keywords: qt6
Version First Reported In: 5.91.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=478951
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Jin Liu 2024-01-04 11:14:00 UTC
SUMMARY
It only happens with the `jdownloader2` app.

STEPS TO REPRODUCE
1. Install `jdownloader2`.
2. Launch Dolphin.
3. Launch jdownloader2.
4. Minimize jdownloader2.

OBSERVED RESULT
Dolphin is not activated.

EXPECTED RESULT
Dolphin is activated.

Another problem that might be related:
After launching jdownloader2, sometimes clicking its icon in the task manager doesn't minimize the window. It can be fixed by activating another app then switching back.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.91.0
KDE Frameworks Version: 5.247.0
Qt Version: 6.7.0
Kernel Version: 6.6.8-arch1-1 (64-bit)
Graphics Platform: offscreen
Processors: 12 × AMD Ryzen 5 5600H with Radeon Graphics
Memory: 13.5 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Comment 1 Nicolas Fella 2024-01-13 20:19:05 UTC
I have not tested jdownloader2, but I can reproduce with any XWayland window. 

See https://bugs.kde.org/show_bug.cgi?id=478951
Comment 2 Jin Liu 2024-01-14 01:36:51 UTC
(In reply to Nicolas Fella from comment #1)
> I have not tested jdownloader2, but I can reproduce with any XWayland
> window. 

Yes. Can reproduce with any XWayland window, too.
Comment 3 Vlad Zahorodnii 2024-01-15 09:24:02 UTC

*** This bug has been marked as a duplicate of bug 478951 ***
Comment 4 Jin Liu 2024-01-31 03:25:08 UTC
Can reproduce in master.
Comment 5 Bug Janitor Service 2024-01-31 14:20:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5080
Comment 6 Zamundaaa 2024-02-02 01:01:53 UTC
Git commit 5896bab86f9655b099c2bf4f88db7879b12bc03a by Xaver Hugl, on behalf of Vlad Zahorodnii.
Committed on 02/02/2024 at 01:01.
Pushed by zamundaaa into branch 'master'.

Activate next window when an X11 window is minimized

It matches the behavior of XdgToplevelWindow.

M  +5    -0    src/x11window.cpp

https://invent.kde.org/plasma/kwin/-/commit/5896bab86f9655b099c2bf4f88db7879b12bc03a
Comment 7 Zamundaaa 2024-02-02 01:19:23 UTC
Git commit e566bdfcd76c0690c6d294c76936407dc7f682c9 by Xaver Hugl, on behalf of Vlad Zahorodnii.
Committed on 02/02/2024 at 01:06.
Pushed by zamundaaa into branch 'Plasma/6.0'.

Activate next window when an X11 window is minimized

It matches the behavior of XdgToplevelWindow.
(cherry picked from commit 5896bab86f9655b099c2bf4f88db7879b12bc03a)

M  +5    -0    src/x11window.cpp

https://invent.kde.org/plasma/kwin/-/commit/e566bdfcd76c0690c6d294c76936407dc7f682c9