Bug 386769

Summary: Dragging desktop to move all windows to another desktop is not restricted to current activity
Product: [Plasma] kwin Reporter: Kishore Gopalakrishnan <kishore96>
Component: effects-desktop-gridAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: g111, nate, notmart
Priority: NOR Keywords: regression
Version: 5.11.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Kishore Gopalakrishnan 2017-11-12 10:02:48 UTC
In the 'present windows' desktop effect, you can drag on an empty region of a desktop (i.e. a region that isn't covered by a window (I have the 'use present windows effect to layout windows' option enabled)) to move all windows in that desktop to another desktop. The expected behaviour is that this only applies to windows in the current activity. However, it applies to windows in all activities that are on that desktop.

Steps to reproduce:
1. Create 2 activities (say 'A' and 'B')
2. Open a window on a desktop (say desktop '2') of activity A
3. Switch to activity B, and open a few windows on desktop 2
4. Activate the desktop grid effect, and drag an empty space in desktop 2 to desktop 1
5. Switch to activity A

Observed result:
The windows in activity B, desktop 2 have moved to desktop 1. The window in activity A has also moved to desktop 1.

Expected result:
The windows in activity B, desktop 2 should move to desktop 1. However the window in activity A desktop 2 should stay on desktop 2.
Comment 1 Martin Flöser 2017-11-12 13:27:39 UTC
I'm not sure whether this is a bug. I can see users wanting both behaviors. Very unsure.
Comment 2 g111 2021-05-25 10:44:18 UTC
Hello,

I also think that this is a bug.

As I understand activities, they do exist to separate different windows for different tasks (e.g. projects). So windows organized in activity A usually are completely independent from windows in activity B. So if I want to move all windows in activity (project) A from one desktop to another I do not want the windows in project B to be moved. (I was really astonished about the current behavior.)

There is only one exception that might make the situation tricky: Windows that are configured to appear on all (or some) activities. In this case I think they have to be moved on all of theses activities. But I would expect that this happens automatically if a window is moved on only the current activity anyway. At least if I move one window manually from one desktop to another, this window is moved on all activities that the window is configured for.

If you are unsure about the right behavior, it should be configurable in the desktop grid effect settings. But for me it is no question that the current behavior feels wrong.

Operating System: Kubuntu 21.04
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.80.0
Qt Version: 5.15.2
Kernel Version: 5.11.0-17-generic
OS Type: 64-bit
Graphics Platform: X11

Kind regards
Gert
Comment 3 Nate Graham 2022-04-11 20:57:37 UTC
Git commit 1e0b0c881e920bebaacea8b3c6ce26a09f3c4a20 by Nate Graham, on behalf of Kishore Gopalakrishnan.
Committed on 11/04/2022 at 20:57.
Pushed by ngraham into branch 'master'.

effects/desktopgrid: only swap windows on current activity

In the desktop grid effect, dragging an empty area of a desktop to
another desktop swaps all windows on the two desktops. This change makes
sure that this matches only windows in the current activity.
FIXED-IN: 5.24.5

M  +1    -1    src/effects/desktopgrid/desktopgrid.cpp

https://invent.kde.org/plasma/kwin/commit/1e0b0c881e920bebaacea8b3c6ce26a09f3c4a20
Comment 4 g111 2022-04-12 06:52:21 UTC
Great! Thank you for the fix!
Comment 5 Kishore Gopalakrishnan 2022-06-02 13:30:24 UTC
This bug happens again in the QML rewrite that was introduced in 5.24.90. 

Should I open this bug, or file a new one?
Comment 6 Nate Graham 2022-06-02 15:09:11 UTC
Oops, looks like that got lost in the QML port, yeah. We can re-open this one.
Comment 7 Bug Janitor Service 2022-07-10 06:22:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2625
Comment 8 Vlad Zahorodnii 2022-07-15 08:58:41 UTC
Git commit ed128064e35aa9fb12f3e188c88c8100aaa1a512 by Vlad Zahorodnii, on behalf of Kishore Gopalakrishnan.
Committed on 15/07/2022 at 08:26.
Pushed by vladz into branch 'master'.

Swapping desktops: only swap windows on current activity.

In the desktop grid effect, dragging an empty area of a desktop to
another desktop swaps all windows on the two desktops. This change makes
sure that this matches only windows in the current activity.

Was earlier fixed in
https://invent.kde.org/plasma/kwin/commit/1e0b0c881e920bebaacea8b3c6ce26a09f3c4a20
, but the bug was reintroduced by the QML rewrite.

M  +1    -1    src/effects/desktopgrid/desktopgrideffect.cpp

https://invent.kde.org/plasma/kwin/commit/ed128064e35aa9fb12f3e188c88c8100aaa1a512
Comment 9 Vlad Zahorodnii 2022-07-15 09:05:06 UTC
Git commit 92866c986cccd0c40c3514b107b4837fa93af35c by Vlad Zahorodnii, on behalf of Kishore Gopalakrishnan.
Committed on 15/07/2022 at 09:05.
Pushed by vladz into branch 'Plasma/5.25'.

Swapping desktops: only swap windows on current activity.

In the desktop grid effect, dragging an empty area of a desktop to
another desktop swaps all windows on the two desktops. This change makes
sure that this matches only windows in the current activity.

Was earlier fixed in
https://invent.kde.org/plasma/kwin/commit/1e0b0c881e920bebaacea8b3c6ce26a09f3c4a20
, but the bug was reintroduced by the QML rewrite.


(cherry picked from commit ed128064e35aa9fb12f3e188c88c8100aaa1a512)

M  +1    -1    src/effects/desktopgrid/desktopgrideffect.cpp

https://invent.kde.org/plasma/kwin/commit/92866c986cccd0c40c3514b107b4837fa93af35c