Allow Activity Switcher to move/add windows to activities by drag and drop from the taskbar
Needs ReviewPublic

Authored by wstephenson on Feb 12 2020, 4:17 PM.

Details

Reviewers
ivan
davidedmundson
Group Reviewers
Plasma
Summary

In the same way that the Activity Pager should (see https://phabricator.kde.org/D27322 for fix) accept dragged windows to move them between Activities, this patch allows the Activity Switcher (meta+q) to move/add (ctrl-drag) windows between/to Activities.

Compare to https://cukic.co/2014/07/15/a-screencast-of-the-activity-switcher-in-plasma-5-1/ (video at https://www.youtube.com/watch?v=uxaDaXW67Oo).

Test Plan

Move window between activities

  1. Setup desktop with two activities, taskbar, window on one activity, activate activity with the window on it
  2. Open Activity Switcher, Drag window's taskbar entry to the other activity's item.
  3. Observe window moves to other activity

Add window to another activity

  1. Setup remaining from previous test
  2. Open Activity Switcher, Ctrl-drag window's taskbar entry to the other activity's item.
  3. Observe window is now on all activities

Move window from all activities to a single activity

  1. Setup remaining from previous test. Window is on all activities
  2. Open Activity Switcher, Drag window's taskbar entry to an activity item
  3. Observe window is now only on one activity

Add window to two out of three activities

  1. Setup remaining from previous test. Window is on 1/2 activities
  2. Open Activity Switcher, Add 3rd activity using Activity Manager
  3. Ctrl-drag window's taskbar entry to the new activity.
  4. Observe window is now on 2/3 activities

Move window to a different 2/3 activities

  1. Setup remaining from previous test. Window is on 2/3 activities
  2. Open Activity Switcher, Activate an activity the window is present on
  3. Drag window's taskbar entry to the activity it is not on
  4. Observe window is now moved to the activity it was dropped on, and is no longer on the current activity

Add window to the only activity it is not on

  1. Setup remaining from previous test. Window is on 2/3 activities
  2. Open Activity Switcher, Activate an activity the window is present on
  3. Ctrl-drag window's taskbar entry to the activity it is not on
  4. Observe window is now present on all activities

Diff Detail

Repository
R119 Plasma Desktop
Lint
Lint Skipped
Unit
Unit Tests Skipped
wstephenson created this revision.Feb 12 2020, 4:17 PM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 12 2020, 4:17 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
wstephenson requested review of this revision.Feb 12 2020, 4:17 PM

There is a change to the QML missing from this diff as it stands, will amend it tomorrow

Removed debug statement;
Added changed qml file to diff.

ivan added a comment.Feb 26 2020, 4:55 PM

This looks cool. The thing I'm missing (correct me if I'm wrong - I'm yet to test the patch) is for it to open the switcher when dragging the window over the switcher applet icon.

In D27353#618452, @ivan wrote:

This looks cool. The thing I'm missing (correct me if I'm wrong - I'm yet to test the patch) is for it to open the switcher when dragging the window over the switcher applet icon.

That would be org.kde.plasma.showActivityManager, I assume? If so, yes, that would be good for completeness. I will also need to add the drop functionality to org.kde.plasma.activitybar then I think this is feature complete.