Allow move or add window to Activities during Dnd using Ctrl modifier
Needs ReviewPublic

Authored by wstephenson on Tue, Feb 11, 3:08 PM.

Details

Reviewers
davidedmundson
hein
Group Reviewers
Plasma
Summary

This allows the familiar file manager semantics of ctrl+drag = copy,
drag = move to be used when dragging and dropping windows between
activities using the taskbar and the activity pager applet.

Also:
The code to handle a window drag from the taskbar to drop on the
Activity Pager to add the window to an Activity was broken,
because the test to see if the drop location is a running activity
still treated the itemId as an integer indexing into an array of running
activity indices, rather than an id string that could be a member of the
list of running activities.

Test Plan

Move window between activities

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

Add window to another activity

  1. Setup remaining from previous test
  2. Ctrl-drag window's taskbar entry to the other activity's pager 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. Drag window's taskbar entry to an activity pager 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. 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. 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. 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

Lint
Lint Skipped
Unit
Unit Tests Skipped
wstephenson created this revision.Tue, Feb 11, 3:08 PM
Restricted Application added a subscriber: plasma-devel. · View Herald TranscriptTue, Feb 11, 3:08 PM
wstephenson requested review of this revision.Tue, Feb 11, 3:08 PM
wstephenson edited the test plan for this revision. (Show Details)Tue, Feb 11, 3:10 PM

Seems sensible +1

applets/pager/plugin/pagermodel.cpp
615

const

616

please port to qCDebug() and uncomment

(or just remove)

Implement feedback from d_ed

Integrate logic fix from https://phabricator.kde.org/D27319

I tried to test dragging multiple windows (as a grouped taskbar entry) but this fails at the first test, outside of my changes, so I think there's an unrelated bug hiding in TaskManager::XWindowTasksModel::winIdsFromMimeData(), which can wait for another patch.

wstephenson edited the summary of this revision. (Show Details)Tue, Feb 11, 10:23 PM
ivan added a subscriber: ivan.Sun, Feb 16, 8:11 AM

Cool idea, I'll have to think of something similar for the regular activity switcher