Bug 423031

Summary: [Wayland] Modifier keys to move (shift), copy (ctrl) and create a link (ctrl+shift) don't work if pressed after I start to drag the file/folder
Product: [Frameworks and Libraries] frameworks-kio Reporter: Patrick Silva <bugseforuns>
Component: generalAssignee: KIO Bugs <kio-bugs-null>
Status: CLOSED UPSTREAM    
Severity: normal CC: a.samirh78, aellionnec, bizyaev, catcool419, d.schroeter, david.scott.brown, fkfd, gerrit.huebbers, gronslet, herzenschein, hi, jf.mundox, kde-bugs, kde.org, kde, kde, kdelibs-bugs, lassi.vaatamoinen, maarten.bezemer, madasi, mata987, max, meven, n0body_special, nate, oded, pasdabonnements, postix, ratajs, sam, sonichedgehog_hyperblast00, s_chriscollins, tomblackwhite
Priority: NOR Keywords: wayland
Version: 5.90.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
URL: https://codereview.qt-project.org/c/qt/qtwayland/+/525413
Latest Commit: Version Fixed In: Qt 6.8
Sentry Crash Report:

Description Patrick Silva 2020-06-15 22:30:40 UTC
STEPS TO REPRODUCE
1. start Wayland session
2. open Dolphin
3. enable split view by pressing F3 and open different locations in each pane
4. drag a file/folder from a pane to another one and do NOT release the mouse button when you stop cursor movement
4. press and hold shift (move here) or ctrl (copy here) or ctrl+shift (link here) modifier keys
5. release the mouse button

OBSERVED RESULT
if you pressed shift (move here)  or ctrl (copy here) in the step 4, context menu opens when you
release the mouse button. If you pressed ctrl+shift (link here) instead, Dolphin copies the dragged
file/folder to destination when you release the mouse button.

EXPECTED RESULT
all modifier keys should work as expected on Wayland

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.19.0
KDE Frameworks Version: 5.71.0
Qt Version: 5.15.0
Comment 1 Patrick Silva 2020-06-15 22:37:09 UTC
(In reply to Patrick Silva from comment #0)
> OBSERVED RESULT
> if you pressed shift (move here) or ctrl (copy here) in the step 4...

ops, I meant step 5 incorrectly numbered 4 lol
Comment 2 Thiago Sueto 2020-11-09 05:57:44 UTC
Can reproduce this consistently on Frameworks 5.75.
Comment 3 Méven Car 2020-11-21 09:45:17 UTC
Related upstream QT bug :
https://bugreports.qt.io/browse/QTBUG-79919
Comment 4 David Edmundson 2021-05-13 23:38:24 UTC
Needs dataDevicev3 which I have pending review upstream
Comment 5 Méven Car 2021-10-25 13:25:24 UTC
A (In reply to David Edmundson from comment #4)
> Needs dataDevicev3 which I have pending review upstream

I guess you are speaking of this one:
https://codereview.qt-project.org/c/qt/qtwayland/+/334777
Comment 6 Patrick Silva 2022-01-13 12:08:38 UTC
qt5-wayland package of KDE Qt available on Arch Linux has dataDevicev3 support but this bug persists.

Operating System: Arch Linux
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Graphics Platform: Wayland
Comment 7 Patrick Silva 2022-03-20 12:21:13 UTC
The modifier key only works if pressed before I start to drag the file/folder.


Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.3
Graphics Platform: Wayland
Comment 8 kde.org 2022-05-14 14:40:43 UTC
(In reply to Patrick Silva from comment #7)
> The modifier key only works if pressed before I start to drag the
> file/folder.
> 
> 
> Operating System: KDE neon Unstable Edition
> KDE Plasma Version: 5.24.80
> KDE Frameworks Version: 5.93.0
> Qt Version: 5.15.3
> Graphics Platform: Wayland

That's the same behavior as on X11.
Comment 9 Patrick Silva 2022-05-14 15:11:48 UTC
(In reply to kde.org from comment #8)
> (In reply to Patrick Silva from comment #7)
> > The modifier key only works if pressed before I start to drag the
> > file/folder.
> > 
> > 
> > Operating System: KDE neon Unstable Edition
> > KDE Plasma Version: 5.24.80
> > KDE Frameworks Version: 5.93.0
> > Qt Version: 5.15.3
> > Graphics Platform: Wayland
> 
> That's the same behavior as on X11.

Not on my system.

Operating System: Arch Linux
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.3
Graphics Platform: Wayland
Comment 10 kde.org 2022-05-14 15:18:51 UTC
(In reply to Patrick Silva from comment #9)
> (In reply to kde.org from comment #8)
> > (In reply to Patrick Silva from comment #7)
> > > The modifier key only works if pressed before I start to drag the
> > > file/folder.
> > > 
> > > 
> > > Operating System: KDE neon Unstable Edition
> > > KDE Plasma Version: 5.24.80
> > > KDE Frameworks Version: 5.93.0
> > > Qt Version: 5.15.3
> > > Graphics Platform: Wayland
> > 
> > That's the same behavior as on X11.
> 
> Not on my system.
> 
> Operating System: Arch Linux
> KDE Plasma Version: 5.24.5
> KDE Frameworks Version: 5.94.0
> Qt Version: 5.15.3
> Graphics Platform: Wayland

Ok, it was the same behavior as on X11 for the last 7 years or so I've been using it. I switched to Wayland a couple of months ago, so I wasn't aware that it was recently fixed on X11, tracked here https://bugs.kde.org/show_bug.cgi?id=388259
Comment 11 Šimon (Simon) Rataj 2022-07-24 13:52:36 UTC
I can confirm presence of this bug in Plasma 5.25.3 (KDE neon 5.25, KDE Frameworks 5.96.0, Qt 5.15.5).
Comment 12 Nate Graham 2022-08-11 17:39:19 UTC
*** Bug 457760 has been marked as a duplicate of this bug. ***
Comment 13 Patrick Silva 2022-10-29 19:00:49 UTC
*** Bug 453786 has been marked as a duplicate of this bug. ***
Comment 14 Oded Arbel 2022-12-28 15:07:23 UTC
With current Neon unstable (Qt 5.15.7, Frameworks 5.101, Plasma 5.26.80) this is still an issue: when dragging a file from one split view of Dolphin to another, modifiers only take effect is held before the click to start dragging or if the modifier was released before releasing the drag.

Also, when dragging across Dolphin windows, even if the modifier was held before starting to drag - it will still not work. The only reliable way to get "force move" or "force copy" behavior is to press and release the modifier after starting to drag. This problem can also be seen with drag operations outside Dolphin.

Also, may be interesting to note that after releasing the modifier, the drag icon does not change unless I move the cursor again, so that my workflow is now looking like this:
1. Click and drag to destination, but don't release.
2. Click (hold and release) the desired modifier key.
3. Observe that confusingly the mouse drag cursor did not change, so consider your life choices (did I click the right modifier?) and maybe do it again to verify. Maybe wiggle the mouse around a bit to see that the icon changes to what I expect.
4. Release the drag.
(or just always use the popup menu)
Comment 15 Artur Rudenko 2023-05-11 14:03:35 UTC
It also appears to be a bug not only in dolphin; for example, in Kate, pressing "ctrl" to move cursor faster will only take effect when pressed before you press arrow keys. X11 works fine. Maybe it's a KWin issue?
Comment 16 Méven 2023-05-12 05:14:07 UTC
(In reply to Artur Rudenko from comment #15)
> It also appears to be a bug not only in dolphin; for example, in Kate,
> pressing "ctrl" to move cursor faster will only take effect when pressed
> before you press arrow keys. X11 works fine. Maybe it's a KWin issue?

Those are both qt issues, not communicating the modifiers change to the app or library.
Comment 17 Patrick Silva 2023-05-13 00:36:51 UTC
*** Bug 463277 has been marked as a duplicate of this bug. ***
Comment 18 Kai Uwe Broulik 2023-12-14 11:54:58 UTC
Potential fix https://codereview.qt-project.org/c/qt/qtwayland/+/525413
Comment 19 n0body_special 2024-01-06 19:57:59 UTC
(In reply to Kai Uwe Broulik from comment #18)
> Potential fix https://codereview.qt-project.org/c/qt/qtwayland/+/525413

That's cool, but how do we apply that fix? I really cannot understand anything from that page. I would appreciate some help, fixing this bug is very important to me
Comment 20 Patrick Silva 2024-01-07 15:26:13 UTC
*** Bug 479481 has been marked as a duplicate of this bug. ***
Comment 21 Dilam 2024-05-17 08:36:27 UTC
I still have the bug in :
Operating System: KDE neon 6.0
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
Kernel Version: 6.5.0-35-generic (64-bit)
Graphics Platform: Wayland

But I know that I am one version behind the last version of KDE framework (6.1.0 instead of 6.2.0) so I am not re-opening the bug report in case the fix is in 6.2.0.

Also someone else is reporting the same bug in bug 484336 (bug report which was not dedicated to it).
Comment 22 postix 2024-05-17 09:22:10 UTC
Dilam, this bug is at least fixed for me on

Operating System: Fedora Linux 40
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0
Graphics Platform: Wayland
Comment 23 Dilam 2024-05-17 11:42:57 UTC
(In reply to postix from comment #22)
> Dilam, this bug is at least fixed for me on

Ok. Thank you. I just have to wait for the update.
Comment 24 Max 2024-05-21 20:30:41 UTC
It should not work yet, as the supposed [fix](https://codereview.qt-project.org/c/qt/qtwayland/+/525413) is open and not merged yet. It even has a merge conflict.

It does seem like kde people have given feedback, and its mostly qt we are waiting on. This is one of the deeper papercuts left in wayland, it would really be great if it was given more priority by them, or if theres a way for kde people to take it over.
Comment 25 Max 2024-05-21 20:56:42 UTC
> It does seem like kde people have given feedback, and its mostly qt we are
> waiting on. ...

I got confused, David Edmundson has not reviewed it yet, maybe it has fallen between the cracks..

Maybe this bug should be reopened since it needs action from kde people still..
Comment 26 Matija 2024-05-23 08:23:12 UTC
(In reply to Dilam from comment #23)
> (In reply to postix from comment #22)
> > Dilam, this bug is at least fixed for me on
> 
> Ok. Thank you. I just have to wait for the update.

Did the update today to Frameworks v6.2.0.
Restarted, but the problem still exists... should we reopen?
Comment 27 Dilam 2024-05-23 08:42:12 UTC
(In reply to Matija from comment #26)
> (In reply to Dilam from comment #23)
> > (In reply to postix from comment #22)
> > > Dilam, this bug is at least fixed for me on
> > 
> > Ok. Thank you. I just have to wait for the update.
> 
> Did the update today to Frameworks v6.2.0.
> Restarted, but the problem still exists... should we reopen?

Yes I did the update and it's still here.

Operating System: KDE neon 6.0
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0
Kernel Version: 6.5.0-35-generic (64-bit)
Graphics Platform: Wayland

I reopen the bug report.
Comment 28 postix 2024-05-23 08:47:37 UTC
Oh sorry, I had swapped steps 4 and 5 from the OT: I had pressed the modifier keys before dragging and that works. 
Otherwise, when dragging first and then pressing the modifier keys, I can also reproduce this bug.

Sorry again for any confusion.
Comment 29 Nate Graham 2024-05-23 15:56:20 UTC
This is still an upstream issue that needs to be fixed in Qt, once the aforementioned patch is merged.
Comment 30 Kai Uwe Broulik 2024-06-05 20:14:52 UTC
Patch has just been merged into Qt 6.8
Comment 31 raymo 2024-06-23 03:45:49 UTC
For more consistent reproduction:
Works: press down modifier key, then press down left mouse button and drag, finally releasing modifier key and mouse button in either order
Works: press down left mouse button and drag, press and release modifier key, release mouse button
Doesn't work: press down left mouse button and drag, press down modifier key, release mouse button, release modifier key
Comment 32 Lassi Väätämöinen 2024-06-23 13:07:00 UTC
(In reply to raymo from comment #31)
> For more consistent reproduction:

Which version were you using for testing?
Comment 33 raymo 2024-06-24 05:22:15 UTC
(In reply to Lassi Väätämöinen from comment #32)
> (In reply to raymo from comment #31)
> > For more consistent reproduction:
> 
> Which version were you using for testing?

qt6-base 6.7.1-4
dolphin 24.05.1-1
kwin 6.1.0-3

on Arch x86_64 6.9.5-arch1-1
Comment 34 Matija 2024-07-08 13:53:53 UTC
(In reply to Kai Uwe Broulik from comment #30)
> Patch has just been merged into Qt 6.8

Don't know where to find that info, but is there some kind of schedule for QT updates?
When can we expect an update to QT 6.8, on KDE Neon user edition?
Comment 35 Patrick Silva 2024-07-10 01:30:29 UTC
I'm using Qt 6.8 beta1 on Arch Linux, and I can confirm that it fixes this bug. \o/