Bug 478951 - XWayland apps cannot be minimized clicking on their Task Manager entries until launching another app or switching to another task
Summary: XWayland apps cannot be minimized clicking on their Task Manager entries unti...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager widgets (show other bugs)
Version: 5.92.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: qt6, regression
: 481415 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-12-23 19:04 UTC by Patrick Silva
Modified: 2024-02-16 19:49 UTC (History)
6 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2023-12-23 19:04:24 UTC
STEPS TO REPRODUCE
1. make sure Thunderbird and Discord run on Xwayland, not natively on Wayland
2. open Discord or Thunderbird via Kickoff
3. try to minimize the app used in the previous step by clicking on its entry in the task manager

OBSERVED RESULT
nothing happens. Cannot reproduce with KDE apps like Dolphin, Konsole and Kate.

EXPECTED RESULT
the app is minimized

SOFTWARE/OS VERSIONS
Plasma 6 beta 2
Comment 1 guimarcalsilva 2023-12-24 23:14:43 UTC
I can reproduce this with Thunderbird, but I noticed the problem goes away if I click on the taskbar entry of another application and then click on Thunderbird's icon again on the taskbar. If I close Thunderbird and open it again the problem comes back.
Comment 2 Nicolas Fella 2023-12-29 17:16:30 UTC
The problem is that in https://invent.kde.org/plasma/plasma-desktop/-/blob/master/applets/taskmanager/package/contents/ui/code/tools.js#L172 model.IsActive is false for newly launched XWayland apps
Comment 3 Nicolas Fella 2024-01-13 20:21:39 UTC Comment hidden (spam)
Comment 4 Bug Janitor Service 2024-01-15 09:19:40 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/3768
Comment 5 Vlad Zahorodnii 2024-01-15 09:24:02 UTC
*** Bug 479388 has been marked as a duplicate of this bug. ***
Comment 6 Vlad Zahorodnii 2024-01-16 11:12:40 UTC
Git commit df5a6097401124b8ecad874ae1a7e01df5e61028 by Vlad Zahorodnii.
Committed on 16/01/2024 at 11:59.
Pushed by vladz into branch 'master'.

libtaskmanager: Fix initialization of IsActive in WaylandTasksModel

The IsActive role does not represent state_active anymore, but rather
the activeWindow property of the WaylandTasksModel::Private.

Unlike Wayland windows, X11 windows can be already active when they are
added. So this case needs to be handled in order to properly initialize
the activeWindow property.

M  +29   -19   libtaskmanager/waylandtasksmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/df5a6097401124b8ecad874ae1a7e01df5e61028
Comment 7 Vlad Zahorodnii 2024-01-16 11:33:42 UTC
Git commit ef9b3c4a9995ee480e271eb8df4030b78b3cbc06 by Vlad Zahorodnii.
Committed on 16/01/2024 at 12:14.
Pushed by vladz into branch 'Plasma/6.0'.

libtaskmanager: Fix initialization of IsActive in WaylandTasksModel

The IsActive role does not represent state_active anymore, but rather
the activeWindow property of the WaylandTasksModel::Private.

Unlike Wayland windows, X11 windows can be already active when they are
added. So this case needs to be handled in order to properly initialize
the activeWindow property.


(cherry picked from commit df5a6097401124b8ecad874ae1a7e01df5e61028)

M  +29   -19   libtaskmanager/waylandtasksmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/ef9b3c4a9995ee480e271eb8df4030b78b3cbc06
Comment 8 Steve Cossette 2024-01-18 14:21:46 UTC
FYI, this is still a problem here, but oddly enough, only on one screen.

I think the best way is to demonstrate this through a video (Well, two) so here they are:

Screen 1, Primary (Works fine): https://www.youtube.com/watch?v=5AqL2hQBwqo
Screen 2 (Glitched): https://www.youtube.com/watch?v=T6ogBHOiL1w
Comment 9 Nate Graham 2024-01-18 21:31:35 UTC
Even with that commit and rebooting the system, though? It just went in a day ago.

Could you write some steps to steps to reproduce in text form? I'm having a hard time following what the videos are showing me and I can't reproduce the issue when I make an XWayland app open on my secondary screen.
Comment 10 Steve Cossette 2024-01-19 02:17:06 UTC
Alright, I got two screens, right? Left screen being my primary screen (In case it matters). On that screen, you'll see in the video, if I click on an icon in the taskbar, it maximizes and un-minimizes just fine.

On the right screen, for me, if a window is minimized, clicking on it will un-minimize it. But if I click on it again to try to minimize it, it won't. And also there's a strange line that shows right on top of the button for some reason, but that's secondary.

Mind you though in my case, this happens regardless of the application type: Xorg or Wayland.

Hopefully that gives some context to the videos.
Comment 11 Steve Cossette 2024-01-19 02:21:28 UTC
(In reply to Steve Cossette from comment #10)
> Alright, I got two screens, right? Left screen being my primary screen (In
> case it matters). On that screen, you'll see in the video, if I click on an
> icon in the taskbar, it maximizes and un-minimizes just fine.
> 
> On the right screen, for me, if a window is minimized, clicking on it will
> un-minimize it. But if I click on it again to try to minimize it, it won't.
> And also there's a strange line that shows right on top of the button for
> some reason, but that's secondary.
> 
> Mind you though in my case, this happens regardless of the application type:
> Xorg or Wayland.
> 
> Hopefully that gives some context to the videos.

By the way, I did recompile plasma-workspace with this commit yesterday: https://invent.kde.org/plasma/plasma-workspace/-/commit/df5a6097401124b8ecad874ae1a7e01df5e61028. Then, I installed it, and rebooted.

The videos/explanations I submitted were after I got done doing this.
Comment 12 Steve Cossette 2024-01-19 16:38:32 UTC
And this morning, it seems to no longer do it.... Mind you I patched & installed the patched plasma-workspace package two days ago, and I shut down my computer every night. I need to find out why this bug triggers...

I guess for now this may need to be closed, if it reoccurs ill reopen it
Comment 13 Nate Graham 2024-02-16 19:49:22 UTC
*** Bug 481415 has been marked as a duplicate of this bug. ***