Bug 352177 - Moving/copying by drag n' drop between dolphin windows does not respect pressed Ctrl/shift
Summary: Moving/copying by drag n' drop between dolphin windows does not respect press...
Status: CLOSED UPSTREAM
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 16.12.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
: 307083 346663 352592 373510 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-09-02 20:55 UTC by d_tassos
Modified: 2018-03-25 17:17 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In: Qt 5.6.3/5.7.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description d_tassos 2015-09-02 20:55:50 UTC
When moving/copying an item (folder/file) from one dolphin window to another by dragging and dropping the said item, dolphin does not sense if you have the ctrl or shift button pressed.

If you have either of them pressed the item should be moved or copied without the pop window asking you if you want to move/copy the item, however in the most recent version dolphin does not seem to sense if you have Ctrl/shift pressed as the pop up windows always appears.

Dolphin 15.08.0

KDE Frameworks 5.13.0
Qt 5.5.0 (built against 5.5.0)
The xcb windowing system

Reproducible: Always

Steps to Reproduce:
1. Open two Dolphin windows
2. Drag a file or folder from one window to the other holding Ctrl or Shift at the same time
3. Drop the file or folder still holding Ctrl or Shift

Actual Results:  
A pop window appears asking if you want to copy or move the file as it does when you are not holding Ctrl/Shift.

Expected Results:  
If you are pressing/holding Ctrl or Shift when dragging and dropping a file from one dolphin windows to another, the pop up window should not appear but directly copy or move the file respectively.
Comment 1 Emmanuel Pescosta 2015-09-03 15:08:47 UTC
Thanks for the bug report, I can reproduce the problem!

After some debugging and digging around in KIO DropJob, I am 100% sure that the bug is in Qt (see https://bugreports.qt.io/browse/QTBUG-894). 

KIO DropJob uses the proposed drop action only when modifier keys were set (because Qt defaults to copy when no modifiers were present), if no modifiers were set KIO DropJob will ask the user. With this Qt Bug the modifier keys are always empty (= NoModifier) and so KIO always opens the popup, even when the right drop action was proposed by Qt.


I have added some debug output to KItemListController::dropEvent:

* Drop with shift pressed:
org.kde.dolphin: KItemListController::dropEvent QFlags<Qt::KeyboardModifiers>(NoModifier) Qt::DropAction(Movion)

* Drop with ctrl pressed:
org.kde.dolphin: KItemListController::dropEvent QFlags<Qt::KeyboardModifiers>(NoModifier) Qt::DropAction(Copion)

* Drop without a modifier key:
org.kde.dolphin: KItemListController::dropEvent QFlags<Qt::KeyboardModifiers>(NoModifier) Qt::DropAction(Copion)
Comment 2 Frank Reininghaus 2015-09-12 17:20:29 UTC
*** Bug 352592 has been marked as a duplicate of this bug. ***
Comment 4 chris.rapson 2016-04-03 18:45:13 UTC
I thought it was this bug? https://bugreports.qt.io/browse/QTBUG-48795
Comment 5 Frederik Gladhorn 2016-09-15 19:48:03 UTC
QTBUG-48795 is about synthetic key events and does not change the behaviour when  it comes to drag and drop.
Comment 6 Frederik Gladhorn 2016-09-15 21:37:36 UTC
If someone could test https://codereview.qt-project.org/#/c/171148/ that would be appreciated. I'll probably not get around to it in the next few days.
Comment 7 Frederik Gladhorn 2016-09-15 22:19:55 UTC
Actually it seems to work for me.
Comment 8 Frederik Gladhorn 2016-09-18 10:02:34 UTC
Fix will be in Qt 5.6.3/5.7.1.
Comment 9 Elvis Angelaccio 2016-12-11 13:06:40 UTC
*** Bug 373510 has been marked as a duplicate of this bug. ***
Comment 10 Elvis Angelaccio 2016-12-11 13:07:04 UTC
*** Bug 346663 has been marked as a duplicate of this bug. ***
Comment 11 Elvis Angelaccio 2016-12-26 14:57:46 UTC
*** Bug 307083 has been marked as a duplicate of this bug. ***
Comment 12 Gregor Mi 2018-03-25 17:17:29 UTC
I assume this can be closed now.