Bug 484647 - Sometimes IDEA can be missing from taskbar
Summary: Sometimes IDEA can be missing from taskbar
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager (show other bugs)
Version: 6.0.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: wayland
Depends on:
Blocks:
 
Reported: 2024-03-28 08:36 UTC by Mosklia
Modified: 2024-09-11 11:53 UTC (History)
5 users (show)

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


Attachments
Step 2: Open more windows from here. (173.54 KB, image/png)
2024-03-28 08:36 UTC, Mosklia
Details
Reproducible Java source (1.26 KB, text/x-java)
2024-06-06 12:46 UTC, Demitrius Belai
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mosklia 2024-03-28 08:36:59 UTC
Created attachment 167879 [details]
Step 2: Open more windows from here.

***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

SUMMARY

I cannot always reproduce this. In fact I do not know how to reproduce it. I just met it unexpectedly while working. All my purposed reproductions are failed.
Sometimes if you open multiple IntelliJ IDEA windows, one of them can be missing from the task bar. The missing one can be focused by using the switcher of Alt-Tab key, but cannot be found on the taskbar.
If all the other IDEA windows are closed, there will be no icon of IDEA on the taskbar, but the missing window can still be focused with Alt-Tab.
Never met this on Plasma 5 (Both wayland and x11).

STEPS TO REPRODUCE
1. Open one IDEA window
2. Open more IDEA with the marked menu
3. Try switching to other existing windows

OBSERVED RESULT

Sometimes one of the IDEA windows can be missing from taskbar.

EXPECTED RESULT

All windows should be on taskbar as expected.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  6.8.2-arch1-1 (64 bit)
(available in About System)
KDE Plasma Version:  6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2

ADDITIONAL INFORMATION

Seems the bug can be reproduced at most once until rebooting the computer.
Comment 1 Mosklia 2024-03-28 09:05:47 UTC
OK now i found a way to reproduce it.

1. Open 2+ IDEA projects in separate windows.
2. Keep all the windows open.
3. Choose File -> Project Structure
4. As the dialog "Project Structure" pops out, you may see the icon on taskbar representing current IDEA window disappears.
5. Current IDEA window becomes a "missing" window. It cannot be accessed via taskbar, but can be accessed via Alt-Tab task switcher.
6. Repeat step 2~4 you may create even more missing windows.

Seems there's other ways to achieve this. I'm not sure.
Comment 2 Demitrius Belai 2024-06-06 11:32:11 UTC
Same here. It only occur in Plasma 6 Wayland and it did not occur in Plasma 5 Wayland. This also happens with Netbeans when opening more than one code window. I believe this is related to Java because there is a government program in my country that also runs on Java and the same thing happens. I will try other Java programs.
Comment 3 Demitrius Belai 2024-06-06 12:46:26 UTC
Created attachment 170202 [details]
Reproducible Java source

Build: javac TestWindow.java
Run: java TestWindow
Comment 4 Demitrius Belai 2024-06-06 12:48:27 UTC
I made a small reproducible Java example.
Comment 5 Demitrius Belai 2024-06-20 22:45:14 UTC
Still in Plasma 6.1

Operating System: Arch Linux 
KDE Plasma Version: 6.1.0
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.1
Kernel Version: 6.9.5-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-7600K CPU @ 3.80GHz
Memory: 15.5 GiB of RAM
Graphics Processor: AMD Radeon RX 6600
Manufacturer: MSI
Product Name: MS-7A74
System Version: 1.0
Comment 6 Demitrius Belai 2024-07-22 01:24:23 UTC
I did some investigations. In the Java example, when you click the button on a Frame to open the Dialog window, that Frame becomes a child of the other Frame (WM_TRANSIENT_FOR). I believe this is a problem with Java itself. However, it works in X11 because only the Dialog has _NET_WM_STATE_SKIP_TASKBAR. Plasma on Wayland started handling transient windows in the commits plasma/plasma-workspace#74d121aea0e and plasma/plasma-workspace#d78058dd7ef, hiding them from the taskbar. Maybe this is OK for Wayland, but not for X11 applications. Wouldn't it be better to have two code paths?
Comment 7 Demitrius Belai 2024-08-04 04:21:45 UTC
I was testing the java application and I saw that after the Dialog close the TRANSIENT_FOR is unset. The libtaskbarmanager is not receive this event because after window is removed from windows list it is destroyed (windows list use std::unique_ptr). I am making the patch and I will create MR soon. This does not resolve complete this bug, the window is still disappear from taskbar when a modal dialog is open. However, it will restore them in taskbar after the dialog is closed.
Comment 8 Demitrius Belai 2024-08-06 16:00:42 UTC
Merge Request: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4586
Comment 9 Méven 2024-09-11 11:47:41 UTC
Git commit f425a26983cad58191e57b7cf823309746428051 by Méven Car, on behalf of Demitrius Belai.
Committed on 11/09/2024 at 11:47.
Pushed by meven into branch 'master'.

waylandtasksmodel: don't remove transient window from windows list

Removing window from windows list causes the window to be destroyed. As
alternative, use the SkipTaskbar role to hide the window.

If PlasmaWindow is destroyed, PlasmaWindow::parentWindowChanged is no longer trigged. So it is no longer possible that Window go back do taskbar if it lose their parent.

To avoid this, use the SkipTaskbar to remove window from taskbar.

Also a missing transients.insert(window, leader) was added.
Related: bug 488596

M  +11   -24   libtaskmanager/waylandtasksmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/f425a26983cad58191e57b7cf823309746428051