Bug 442321

Summary: Task manager sometimes opens new instance of an already-running app on left click when using wayland
Product: [Plasma] plasmashell Reporter: zellox <zellox>
Component: Task Manager and Icons-Only Task ManagerAssignee: Eike Hein <hein>
Status: CONFIRMED ---    
Severity: normal CC: 1i5t5.duncan, andihartmann, anubhabghosh.me, bigsqueaks, d.schroeter, kde, kubapet, mangoo, nate, plasma-bugs, postix, qydwhotmail, rocihic162, sites+kdebugs, sourcework, zellox
Priority: NOR Keywords: wayland
Version: 5.25.4   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: task manager while bug is occuring

Description zellox 2021-09-12 06:48:17 UTC
SUMMARY
When using wayland and the task manager (not the icon-only one), sometimes plasma will get into a state such that left clicking on an already-opened app in the task manager will launch a new instance of that app instead of opening that already-opened app

STEPS TO REPRODUCE
1. Use wayland and the task manager
2. Use the following settings in task manager (do not group, sort manually, enable "minimizes the task", midle-clicking "opens a new instance", enable "cycles through tasks")
3. Wait for the issue to occur
4. Left click on any opened application

OBSERVED RESULT
A new instance of that application starts

EXPECTED RESULT
The already-running app window should show

SOFTWARE/OS VERSION
Linux/KDE Plasma: Arch Linux, Plasma 5.22 (latest)
(available in About System)
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.85.0 
Qt Version: 5.12.2

ADDITIONAL INFORMATION
If the bug occurs, restarting will temporarily fix the problem. Opening task manager settings and toggling clicking active task "minimises the task" and saving will also temporarily fix the problem (although probably any save to the settings will fix it).

This is not related to my keyboard as it still occurs if the keyboard is unplugged.
Comment 1 Nate Graham 2021-09-16 20:15:59 UTC
Haven't seen this yet. Which apps? Is it consistent?
Comment 2 zellox 2021-09-16 22:06:27 UTC
When it happens, it affects all apps on the task manager. It occurs probably every 2-3 days. This is on a relatively new install from earlier this year.

Is there any debug logs I can get that might help (when it occurs)?
Comment 3 Bug Janitor Service 2021-10-01 04:35:57 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 zellox 2021-10-01 05:11:52 UTC
See info above
Comment 5 zellox 2021-10-17 03:56:55 UTC
Some further info. Clicking on e.g. the kde notification systray icon will temporarily fix the bug. Will test 5.23 when it is released on arch linux.
Comment 6 Nate Graham 2022-01-12 17:05:09 UTC
It's released now. Is it still happening in 5.23?
Comment 7 zellox 2022-01-12 22:05:56 UTC
(In reply to Nate Graham from comment #6)
> It's released now. Is it still happening in 5.23?

Yep it's still occurring on 5.23.
Comment 8 Nate Graham 2022-01-13 19:50:14 UTC
Oh! I might know what this is. Can you attach a screenshot of your task manager when it's in this state?
Comment 9 zellox 2022-01-15 23:02:37 UTC
(In reply to Nate Graham from comment #8)
> Oh! I might know what this is. Can you attach a screenshot of your task
> manager when it's in this state?

Sure will do. Might take a while as I'm using this particular desktop (with wayland) less often, but will reply once I get it.
Comment 10 Bug Janitor Service 2022-01-30 04:37:11 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 11 zellox 2022-01-30 05:26:53 UTC
Pending recurrence (I use this desktop less often currently).
Comment 12 Nate Graham 2022-01-30 05:58:32 UTC
99% sure this is Bug 429168.

*** This bug has been marked as a duplicate of bug 429168 ***
Comment 13 zellox 2022-01-30 06:02:46 UTC
(In reply to Nate Graham from comment #12)
> 99% sure this is Bug 429168.
> 
> *** This bug has been marked as a duplicate of bug 429168 ***

What makes you say that?
Comment 14 Duncan 2022-01-30 18:55:37 UTC
(In reply to zellox from comment #13)
> (In reply to Nate Graham from comment #12)
> > 99% sure this is Bug 429168.
> > 
> > *** This bug has been marked as a duplicate of bug 429168 ***
> 
> What makes you say that?

[as original reporter of the duped bug, hope this answers your question]

While the duped bugs don't seem to be identical (mine won't show running windows at all, for instance, yours and some other dupes show running windows normally but the theory seems to be that it's losing track of the running instances so starts a new one if clicking on a pinned icon), I believe they're being marked dupe on the theory that the investigation and fix for any of them will be a sufficiently big change that the others will either be fixed with it, or at minimum, change the situation sufficiently that closing them all together and filing new bugs for any remaining buggy behavior would be the most efficient way forward.

I actually expect these other "works intermittently" bugs (including this one) to be fixed first, but with any luck that'll fix my bug too, and if not, it's likely to at least point to a fix for mine.  (I'm not a dev but can do the occasional hack-patch, and as a live-git user, quite often commits fixing other people's bugs are the pointer I need to allow me to do the hack-patch fixing mine.  Tho in this case it may actually simply point me at the component I seem to be missing and I can either install it or decide it's not worth the hassle and that I must continue using alternative solutions.)
Comment 15 Nate Graham 2022-02-15 15:09:16 UTC
The bug this was marked as a duplicate of was just fixed in Plasma 5.24.1, which was released today. Can you upgrade and see if it's fixed for you too?
Comment 16 zellox 2022-02-16 11:22:46 UTC
(In reply to Nate Graham from comment #15)
> The bug this was marked as a duplicate of was just fixed in Plasma 5.24.1,
> which was released today. Can you upgrade and see if it's fixed for you too?

Sure will test it now. I haven't encountered the bug for the past two weeks (updated to 5.24) which is promising.
Comment 17 zellox 2022-02-18 07:59:03 UTC
Just to close the loop but I think this is resolved. I haven't encountered this bug for a while. Marking as fixed.
Comment 18 zellox 2022-08-24 13:29:20 UTC
This is still occurring unfortunately. I have attached a screenshot of the task manager when this is occurring as requested.

KDE Plasma 5.25.4
KDE frameworks 5.96.0
QT 5.15.5
Comment 19 zellox 2022-08-24 13:29:51 UTC
Created attachment 151551 [details]
task manager while bug is occuring
Comment 20 squeaks 2022-08-31 02:21:14 UTC
I have had this bug happen rarely. I ignored it, it seemed to not happen for a month or longer. It just happened again. The circumstances were: I had not used my computer all day, when I entered the screenlock password, my desktop was a grey screen with my mouse cursor. The only thing I could do besides ctrl+alt+Fn, was alt+space to open KRunner and execute 'kstart5 plasmashell' and the desktop appeared. No programs were shown in my task manager panel. I clicked programs pinned to my task manager, and they started. Like vivaldi, I had eight windows open up. Clicking any of the windows would open a new Vivaldi window. Same for my foot window, or any other program. The workaround I immediately used was right click worked properly and I could gain focus of windows that way.

Comment 5 suggestion to click on the notification area fixed the left click opening new windows back to normal selection mode, which is left-click places windows on top when left-clicked in the task manager. 

For the most part KDE works great for me, but I think there are a few, perhaps wayland related, issues. I use three monitors. I add the following for relatedness or completeness.

1) Maybe every other day, when the screensaver or screenlock is timed on, all of my screens will display the same desktop image, instead of my desktop spanning across three monitors. To fix this, I go into System Settings > Display and Monitor, and re-arrange and re-size the overlayed monitor rectangles to my normal desktop setup.

2) Daily, when I unlock my system from the screenlock, applications are somehow re-arranged across my three monitors. Curiously, not all on the same monitor.

3) Daily but less frequently than apps re-arranging, opening menus (File, Edit, etc) will not be placed as expected, they appear somewhere else floating on the screen. Their position may be related to screen edges or corners. I can't remember them appearing just in the middle randomly.

Operating System: Arch Linux
KDE Plasma Version: 5.25.4
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5
Kernel Version: 5.19.2-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 24 × AMD Ryzen 9 3900X 12-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: AMD Radeon R9 390 Series
Comment 21 Andreas Hartmann 2022-11-30 17:04:00 UTC
Same problem here with Plasma 5.26.3. Left click on an already running app (icon) in the taskbar opens a new instance of the app. This happens with each active program - not just one. Mouse over the program icon until the small preview of the program appears and clicking on this preview works as expected.

As zellox wrote, clicking on the notification systray makes the problem disappear here, too.
Comment 22 Jakub Petrzilka 2023-01-17 19:43:09 UTC
Exactly the same issue happens to me.. Time to time, like mentioned, at least once per day. It affects all apps and it keeps opening new instances. Once I click on the systray or minimize all windows and click desktop, the problem disappears and clicking certain app in taskbar reactivates the existing instance(s) again.
It gets really annoying
Comment 23 Fushan Wen 2023-01-24 17:16:12 UTC
If anyone feels the bug is unbearable, https://invent.kde.org/plasma/kwin/-/merge_requests/3481 is worth a try. However, the fix is not the best fix so it won't be merged to upstream kwin.

STEPS TO REPRODUCE:

- Enable "Textual list"
- Open many Konsole windows
- Open the textual list by clicking the group parent task of Konsole
- Shift+Click one task item in the list
Comment 24 Nate Graham 2023-02-06 19:45:15 UTC
*** Bug 465118 has been marked as a duplicate of this bug. ***
Comment 25 Tomasz Chmielewski 2023-05-20 10:35:13 UTC
This happens also for me - randomly - on Kubuntu 23.04. Extremely annoying.
Comment 26 Nate Graham 2023-09-20 17:22:38 UTC
*** Bug 465377 has been marked as a duplicate of this bug. ***
Comment 27 Roland Tapken 2023-12-20 15:30:13 UTC
I also expire this problem in Debian 12 (Plasma 5.27.5-2).
Comment 28 Roland Tapken 2023-12-20 15:33:26 UTC
I'm not quite sure but it may be related with Vivaldi. I just closed the browser, re-opened it and the behavior suddenly disappeared.

As far as I remember, it could always have been the case that a Vivaldi window was open when the bug occurred, even if the problem is not limited to the Vivaldi-Window when it appeared. Another user also mentioned Vivaldi in comment #c20.
Comment 29 squeaks 2023-12-20 15:44:26 UTC
(In reply to Roland Tapken from comment #28)
> I'm not quite sure but it may be related with Vivaldi. I just closed the
> browser, re-opened it and the behavior suddenly disappeared.
> 
> As far as I remember, it could always have been the case that a Vivaldi
> window was open when the bug occurred, even if the problem is not limited to
> the Vivaldi-Window when it appeared. Another user also mentioned Vivaldi in
> comment #c20.

I am the commenter in #20. I have not experienced this bug in months now. I also coincidentally have quit using vivaldi. However, I may have had some hardware changes, and many other updates.

Operating System: Arch Linux 
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.112.0
Qt Version: 5.15.11
Kernel Version: 6.6.7-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen 9 5950X 16-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: AMD FirePro W5100
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: X570 AORUS MASTER
System Version: -CF
Comment 30 Roland Tapken 2023-12-20 18:25:54 UTC
I have tried the patch from #23, it does not solve the problem
Comment 31 Tomasz Chmielewski 2023-12-20 19:11:26 UTC
Just happened for me today with Konsole.

KDE Plasma Version: 5.27.10
KDE Frameworks version: 5.112.0
Qt Version: 5.15.10
Comment 32 Roland Tapken 2023-12-20 21:07:42 UTC
I just found out that when this behaviour occurs, Wayland interprets the normal mouse click as "middle mouse button". And I have the feeling that this does not only affect the taskbar, because also the tabs in Vivaldi behaved weird in this situation.

Workaround, at least for the taskbar: Disable the middle mouse click function in the taskbar settings.
Comment 33 Tomasz Chmielewski 2023-12-20 21:26:58 UTC
> Workaround, at least for the taskbar: Disable the middle mouse click function in the taskbar settings.

Where exactly is this setting?
Comment 34 zellox 2023-12-20 21:42:12 UTC
(In reply to Tomasz Chmielewski from comment #33)
> > Workaround, at least for the taskbar: Disable the middle mouse click function in the taskbar settings.
> 
> Where exactly is this setting?

Right click task bar -> more -> configure task manager -> behavior -> configure "middle-clicking any task"

I never considered this workaround but it's not ideal because then you'll get getting strange behaviours in other apps (as all left clicks will act like middle clicks) and unless you remember this, you might think it's some other weird bug and waste time debugging that.

I still get this bug but less frequently. Probably about once every 2-3 weeks.
Comment 35 Jamie 2024-01-05 21:46:46 UTC
I also have this issue. One thing I've noticed is that this bug only occurs for me when I have more than one virtual desktop. When deleting all extra virtual desktops on Wayland it works as expected. 

To reproduce on my end, I open Firefox on virtual desktop one and use a keyboard shortcut to go to the right desktop then a shortcut to go back to the left desktop (original with Firefox open), and this reported bug occurs where clicking on FF in the task manager opens a new instance instead of showing the existing one(s). 

After initiating the above steps, double clicking the application launcher to open and close it seems to fix it in that FF will now show the current instances instead of opening new ones. Although, moving virtual desktops again will trigger this bug and I would have to double click the application manager to set it back to normal. Disabling the middle mouse click function in taskbar settings, as mentioned in a comment here, did not work in my instance.
Comment 36 kderocks38 2024-08-09 16:41:55 UTC
plasma 5.27.8 ; still happening from time to time