Bug 427579 - Activating wants-attention window in another activity goes to the wrong virtual desktop
Summary: Activating wants-attention window in another activity goes to the wrong virtu...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: activities (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Eike Hein
URL:
Keywords:
: 498087 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-10-12 10:03 UTC by Oded Arbel
Modified: 2025-01-04 04:52 UTC (History)
5 users (show)

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


Attachments
Screencast showing the problem (2.11 MB, video/webm)
2020-10-12 10:05 UTC, Oded Arbel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oded Arbel 2020-10-12 10:03:52 UTC
SUMMARY

With multiple virtual desktops, when a window on another activity wants attention, the task manager shows the wants-attention window on even if it is set to only show windows from the current activity (this is fine), but when clicking on it the taskbar opens the correct activity but not the correct virtual desktop - so we get to the new activity and don't see the attention seeking window, so we have to click the task manager entry again.

STEPS TO REPRODUCE
1. Set up two or more virtual desktops
2. Set up two or more activities
3. Set the task manager to "show only tasks" "from current activity"
4. In one activity start an application and set it up to demand attention in a few seconds - for example: launch Konsole and run "sleep 10; echo $'\a'" in it - by default Konsole is configured to demand attention when it gets a BELL in standard output.
5. Switch to another virtual desktop then immediately switch to a second activity. Wait for the application to demand attention.

OBSERVED RESULT

A task manager entry for Konsole would appear and demand attention. Clicking on it would change activity but to the last virtual desktop on the first activity - where there is no Konsole window. Clicking the Konsole task manager entry again will take you to the correct virtual desktop.

EXPECTED RESULT

Clicking the task manager entry demanding attention should take the user to where that window is - by switching to the window's activity, switching to the window's virtual desktop and raising the window. Currently it only does one of the first two.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.20.80 (but also observed in 5.19.90 and possibly earlier)
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.0
Comment 1 Oded Arbel 2020-10-12 10:05:56 UTC
Created attachment 132292 [details]
Screencast showing the problem

This screencast is showing the behavior with Eclipse demanding attention. As can be seen, the task manager entry remains demanding attention after clicking once (and switching activity). In my tests with Konsole it doesn't work that way - after the first click the task manager entry loses the attention flag and if you have multiple windows on the destination activity - it might be difficult to find the correct window that demanded attention.
Comment 2 Eric Edlund 2022-09-18 14:33:56 UTC
This is caused because kactivitymanagerd remembers and sets the virtual desktop on activity switch. When kwin switches activity to go to the active window, the daemon then sets the desktop to the last recorded from that activity. To fix this, we need to move this functionality into kwin.
Comment 3 Bug Janitor Service 2022-09-28 15:04:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kactivitymanagerd/-/merge_requests/33
Comment 4 Bug Janitor Service 2022-09-28 15:08:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3011
Comment 5 Bug Janitor Service 2024-06-10 17:01:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5871
Comment 6 Zamundaaa 2024-12-03 21:22:36 UTC
Git commit 7408d8f9c8cc4aae88bd4e844cc2ee221af00b6a by Xaver Hugl.
Committed on 03/12/2024 at 20:16.
Pushed by zamundaaa into branch 'master'.

activities: don't remember virtual desktops when intentionally switching to a different one

M  +1    -1    src/activation.cpp
M  +4    -1    src/activities.cpp
M  +5    -1    src/activities.h
M  +1    -1    src/scripting/workspace_wrapper.cpp

https://invent.kde.org/plasma/kwin/-/commit/7408d8f9c8cc4aae88bd4e844cc2ee221af00b6a
Comment 7 Nate Graham 2025-01-04 04:52:04 UTC
*** Bug 498087 has been marked as a duplicate of this bug. ***