Bug 482339 - Tasks Show on incorrect screen after monitor reconnected
Summary: Tasks Show on incorrect screen after monitor reconnected
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager (show other bugs)
Version: 6.0.0
Platform: Other Linux
: HI normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: multiscreen
: 482487 482530 482905 483738 484175 484255 484780 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-03-03 19:32 UTC by Bradley Nelson
Modified: 2024-05-23 13:32 UTC (History)
18 users (show)

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


Attachments
Screenshot with some notes (593.80 KB, image/png)
2024-03-03 19:32 UTC, Bradley Nelson
Details
Display Config (593.80 KB, image/png)
2024-03-03 19:33 UTC, Bradley Nelson
Details
Screenshot with some notes (1.37 MB, image/png)
2024-03-03 19:35 UTC, Bradley Nelson
Details
Display Config (288.81 KB, image/png)
2024-03-03 19:35 UTC, Bradley Nelson
Details
Task bar settings popup in middle of screen (1009.11 KB, image/png)
2024-03-07 22:03 UTC, david
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bradley Nelson 2024-03-03 19:32:56 UTC
Created attachment 166372 [details]
Screenshot with some notes

SUMMARY

Tasks show on the wrong screen as well as the expected screen but can't be click on the correct screen


STEPS TO REPRODUCE
1. Configure multiple monitors 
2. Add a panel with a task bar to each monitor
3. set task bar to only show tasks from current screen.
4. wait for session go to sleep
5. Wake it up

OBSERVED RESULT
The panel on the left most screen shows all tasks. Tasks are still shown on other screens but can't be left clicked to activate the application or right click for more options.

EXPECTED RESULT
Tasks are only shown when on that screen and can be clicked to activate.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Nixos Unstable
(available in About System)
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2



ADDITIONAL INFORMATION

Copy Details from about system
Operating System: NixOS 24.05
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.6.18 (64-bit)
Graphics Platform: Wayland
Processors: 20 × 12th Gen Intel® Core™ i7-12700KF
Memory: 31.2 GiB of RAM
Graphics Processor: AMD Radeon RX 6650 XT


Display configuration
Three Screens with the center one being set to primary
Comment 1 Bradley Nelson 2024-03-03 19:33:37 UTC
Created attachment 166373 [details]
Display Config
Comment 2 Bradley Nelson 2024-03-03 19:35:07 UTC
Created attachment 166374 [details]
Screenshot with some notes
Comment 3 Bradley Nelson 2024-03-03 19:35:40 UTC
Created attachment 166375 [details]
Display Config
Comment 4 Bradley Nelson 2024-03-03 21:10:25 UTC
Restarting plasmashell fixes it until the next sleep
Comment 5 Doug 2024-03-04 05:53:07 UTC
Cannot reproduce with Task Manager or IOTM, both are working as should.

Operating System: KDE neon Testing Edition
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.5.0-21-generic (64-bit)
Graphics Platform: Wayland
Processors: 12 × Intel® Core™ i7-9750H CPU @ 2.60GHz
Memory: 15.4 GiB of RAM
Graphics Processor: AMD Radeon Pro WX 3200 Series
Comment 6 fanzhuyifan 2024-03-06 04:04:01 UTC
*** Bug 482487 has been marked as a duplicate of this bug. ***
Comment 7 david 2024-03-06 13:13:57 UTC
I've recently observed the bug can manifest on some task bars and not others, but not consistently.

The task bar on my primary monitor (as specified in the display preferences priority list) is frequently unaffected, but the task bars on my other two monitors are.
Comment 8 Nate Graham 2024-03-07 15:27:18 UTC
Can reproduce with two screens. The Task Manager on the left-most (primary) screen shows tasks for all screens. The Task Manager on the right (secondary) screen correctly shows tasks only on its screen.

For me it doesn't happen after sleep though; it's just always happening.

Bug 482530 reports similar but not identical symptoms.

I suspect there are some mixed signals in the per-monitor task detection here just in general which are causing all the issues.
Comment 9 david 2024-03-07 21:47:29 UTC
(In reply to Nate Graham from comment #8)
> For me it doesn't happen after sleep though; it's just always happening.

I'm not convinced it's due to sleep anymore ... I extended my monitors sleep to 1 hr and noticed it happening again, even though the monitors never went to sleep.

Didn't notice the change though. :(
Comment 10 david 2024-03-07 22:02:20 UTC
I don't know if this is relevant or not, but when I right click on the task bar, to change settings or change to an alternative, the popup shows up in the middle of the screen sometimes.

I'll attach a screen shot.
Comment 11 david 2024-03-07 22:03:23 UTC
Created attachment 166641 [details]
Task bar settings popup in middle of screen
Comment 12 Maxime Poulin 2024-03-08 02:50:05 UTC
Same issue as well. 3 monitors, middle one is primary and is the only one where the task manager only shows the correct entries.

In my case all 3 of them are fully functional. It'll even animate the windows minimizing and unminimizing on the correct monitor, even roughly targets the correct button. So if I toggle a window that's on the right monitor from the left monitor's task manager, the window genie animation happens on the right monitor into and out of the correct button in the task manager.

Operating System: Arch Linux 
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.7.8-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 32 × AMD Ryzen Threadripper 1950X 16-Core Processor
Memory: 31.3 Gio of RAM
Graphics Processor: AMD Radeon RX 570 Series
Graphics Processor: AMD Radeon RX Vega
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7B09
System Version: 1.0
Comment 13 qlum 2024-03-08 12:33:57 UTC
I am unsure if this is the same bug, but I have observed the following behavior when using the option to only show tasks on the current screen:
Whenever a monitor disconnect or gets connected, the task manager on one screen may end up showing tasks of all monitors.
I suspect this is the problem the OP is encountering when waking up from sleep, somewhere along the way a screen gets disconnected and reconnected.

Another related case where this fails, is when moving panels between monitors.
If you move a panel with a task manager showing only tasks from one screen to a different monitor, it will still show tasks from the monitor it was on before.
So if the panel was first on monitor 1 and is switched around with the panel on monitor 2, the panel on monitor 2 will show the tasks on monitor 1 and vise versa. 

I have confirmed at least the first case on 2 systems, I think these issues when I switched to the plasma 6 beta, but never got around confirming / reporting them.
Comment 14 qlum 2024-03-08 12:50:34 UTC
I suspect that this issue is simply that the task manager does not get updated whenever it moves to a different screen. 
In that case from stand-by it may just have been on no screen at all and still referencing that after waking up.
Comment 15 Bradley Nelson 2024-03-08 15:39:03 UTC
(In reply to qlum from comment #13)
> I am unsure if this is the same bug, but I have observed the following
> behavior when using the option to only show tasks on the current screen:
> Whenever a monitor disconnect or gets connected, the task manager on one
> screen may end up showing tasks of all monitors.
> I suspect this is the problem the OP is encountering when waking up from
> sleep, somewhere along the way a screen gets disconnected and reconnected.
> 
> Another related case where this fails, is when moving panels between
> monitors.
> If you move a panel with a task manager showing only tasks from one screen
> to a different monitor, it will still show tasks from the monitor it was on
> before.
> So if the panel was first on monitor 1 and is switched around with the panel
> on monitor 2, the panel on monitor 2 will show the tasks on monitor 1 and
> vise versa. 
> 
> I have confirmed at least the first case on 2 systems, I think these issues
> when I switched to the plasma 6 beta, but never got around confirming /
> reporting them.

This does appear to the the case. I can reproduce it by disconnecting a monitor and reconnecting it. Task manager also behave strangely when moving a panel to a different monitor.
Comment 16 Bradley Nelson 2024-03-08 15:43:53 UTC
STEPS TO REPRODUCE
1. Configure multiple monitors 
2. Add a panel with a task bar to each monitor
3. set task bar to only show tasks from current screen.
4. Open Settings and Disable a monitor
5. Reenable

OBSERVED RESULT
The panel on the left most screen shows all tasks. Tasks are still shown on other screens but can't be left clicked to activate the application or right click for more options.

EXPECTED RESULT
Tasks are only shown when on that screen and can be clicked to activate.
Comment 17 david 2024-03-08 21:58:38 UTC
*** Bug 482905 has been marked as a duplicate of this bug. ***
Comment 18 david 2024-03-08 21:59:47 UTC
*** Bug 482530 has been marked as a duplicate of this bug. ***
Comment 19 Fushan Wen 2024-03-10 03:29:58 UTC
Cannot reproduce on X11
Comment 20 david 2024-03-11 13:01:03 UTC
(In reply to Fushan Wen from comment #19)
> Cannot reproduce on X11

I experience the same behavior on both wayland and x11.
Comment 21 Simone Lazzaris 2024-03-11 13:59:35 UTC
I get the same on my setup, but I don't even need to disable a monitor.

STEPS TO REPRODUCE
1. Configure multiple monitors 
2. Add a panel with a task bar to each monitor
3. set task bar to only show tasks from current screen.

OBSERVED RESULT
The panel on the left most screen shows all tasks. Tasks are still shown on other screens but can't be left clicked to activate the application or right click for more options. 

EXPECTED RESULT
Tasks are only shown when on that screen and can be clicked to activate.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Archlinux
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Comment 22 jrouth 2024-03-13 13:36:15 UTC
(In reply to qlum from comment #14)
> I suspect that this issue is simply that the task manager does not get
> updated whenever it moves to a different screen. 
> In that case from stand-by it may just have been on no screen at all and
> still referencing that after waking up.

This inspired me to try restarting Plasma. Sure enough, now all my tasks are on the correct monitors. Thanks for helping find a workaround!
Comment 23 david 2024-03-13 13:57:59 UTC
(In reply to jrouth from comment #22)
> This inspired me to try restarting Plasma. Sure enough, now all my tasks are
> on the correct monitors. Thanks for helping find a workaround!

What's the best way to restart Plasma?

I've seen reference to running 'plasmashell --replace', 'kquitapp5' (now I assume is kquitapp6), etc.
Comment 24 jrouth 2024-03-13 14:20:24 UTC
(In reply to david from comment #23)
> What's the best way to restart Plasma?
> 
> I've seen reference to running 'plasmashell --replace', 'kquitapp5' (now I
> assume is kquitapp6), etc.

I used 'plasmashell --replace' and then sent it to the background, but I would guess that is not the "best way". Hopefully someone else watching this has a better idea :)
Comment 25 Nate Graham 2024-03-13 16:10:15 UTC
If you're using the systemd-enabled Plasma startup feature (which is on by default), then the preferred approach is to run `systemctl restart --user plasma-plasmashell.service`
Comment 26 Bug Janitor Service 2024-03-13 17:29:08 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4063
Comment 27 david 2024-03-13 17:37:58 UTC
(In reply to Nate Graham from comment #25)
> If you're using the systemd-enabled Plasma startup feature (which is on by
> default), then the preferred approach is to run `systemctl restart --user
> plasma-plasmashell.service`

That works in general, but I notice that chrome doesn't restart the way other apps do.

<shrug/>
Comment 28 Bug Janitor Service 2024-03-14 12:29:22 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libplasma/-/merge_requests/1078
Comment 29 Simone Lazzaris 2024-03-15 15:37:53 UTC
(In reply to Nate Graham from comment #25)
> If you're using the systemd-enabled Plasma startup feature (which is on by
> default), then the preferred approach is to run `systemctl restart --user
> plasma-plasmashell.service`

This workaround works for me
Comment 30 Fushan Wen 2024-03-15 17:58:11 UTC
Git commit a0b8bb2a7bfa153b6e5923de019ac8b50f1be395 by Fushan Wen.
Committed on 15/03/2024 at 17:56.
Pushed by fusionfuture into branch 'master'.

Don't emit `screenGeometryChanged` when screenId == lastScreen

When screenId is -1 the screen geometry is invalid.

M  +1    -1    src/plasma/containment.cpp

https://invent.kde.org/plasma/libplasma/-/commit/a0b8bb2a7bfa153b6e5923de019ac8b50f1be395
Comment 31 Nate Graham 2024-03-16 00:32:51 UTC
Is that expected to fix the issue for anyone?
Comment 32 Fushan Wen 2024-03-16 03:21:12 UTC
(In reply to Nate Graham from comment #31)
> Is that expected to fix the issue for anyone?

https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4063 is also required
Comment 33 Fushan Wen 2024-03-19 08:59:04 UTC
Git commit 6d543aca43858f707b32e1e08c39bfd7b3ffaf8e by Fushan Wen.
Committed on 19/03/2024 at 08:41.
Pushed by fusionfuture into branch 'master'.

shell: emit screenGeometryChanged when panel is ready

When screenGeometryChanged is emitted in `handleScreenOrderChanged`,
only desktops are ready. Panels are still in the waiting list and do not
have a associated containment, so those containments do not have a valid
id for screen, which is required to get a valid screen geometry.
Related: bug 481736
FIXED-IN: 6.0.3

M  +1    -0    shell/shellcorona.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/6d543aca43858f707b32e1e08c39bfd7b3ffaf8e
Comment 34 Fushan Wen 2024-03-19 09:23:46 UTC
Git commit bd226094ccb3d143538553ec31add3133b9a5f34 by Fushan Wen.
Committed on 19/03/2024 at 09:11.
Pushed by fusionfuture into branch 'Plasma/6.0'.

shell: emit screenGeometryChanged when panel is ready

When screenGeometryChanged is emitted in `handleScreenOrderChanged`,
only desktops are ready. Panels are still in the waiting list and do not
have a associated containment, so those containments do not have a valid
id for screen, which is required to get a valid screen geometry.
Related: bug 481736
FIXED-IN: 6.0.3


(cherry picked from commit 6d543aca43858f707b32e1e08c39bfd7b3ffaf8e)

M  +1    -0    shell/shellcorona.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/bd226094ccb3d143538553ec31add3133b9a5f34
Comment 35 fanzhuyifan 2024-03-21 16:47:26 UTC
*** Bug 484175 has been marked as a duplicate of this bug. ***
Comment 36 Nicolas Fella 2024-03-22 19:55:57 UTC
*** Bug 483738 has been marked as a duplicate of this bug. ***
Comment 37 Nate Graham 2024-03-25 18:33:48 UTC
*** Bug 484255 has been marked as a duplicate of this bug. ***
Comment 38 Andrew Shark 2024-03-27 12:34:20 UTC
I had this bug, prepared a bug report, only found this one when was filing my.

Thanks for the fix!
Comment 39 fanzhuyifan 2024-03-30 22:20:54 UTC
*** Bug 484780 has been marked as a duplicate of this bug. ***