-
Notifications
You must be signed in to change notification settings - Fork 186
Issue #247 - [GTK][Wayland] Drag&drop gets stuck #248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #247 - [GTK][Wayland] Drag&drop gets stuck #248
Conversation
c2ee77b to
03bb4ee
Compare
058d5a3 to
d1c274e
Compare
|
@iloveeclipse could you please review? |
|
@SyntevoAlex : I still have RHEL 7.9 and no Wayland, so I can't really review that. |
|
@iloveeclipse just took a look. Comparing this patch against master there is a very noticeable decrease in the amount of times that dragStart/dragFinish show up in the console when clicking rapidly while moving the mouse slowly. There are instances where I can trigger the bug still, where only dragStart shows up. However, the bug does seem to have decreased in frequency significantly, and the greatly reduced amount of drags triggered seems like a more desired outcome anyway. |
Either it's not "rapidly" or not "slowly" :) GTK requires mouse to move 8px from starting point in order for When I move mouse slowly and click rapidly, with the patch, drag&drop never begins. When I move mouse faster, bug is still reproducible. But this is not something people would do. The original bug was easily triggered when I intended to simply double-click a TreeItem and didn't intend to do weird things. So it can be said that the patch prevents accidental drag&drop when double clicking, and by this, it also prevents stuck drag&drop when double clicking for realistic purposes. |
Agreed. For all realistic cases, this patch resolves the issue. I had to do some mouse wizardry (clicking the mouse waay too fast...) to trigger the bug. |
|
You mean, move mouse too fast? |
|
Reminder: PR is still not merged. |
|
@akurtakov is there anything that block this PR from being merged? |
|
I just haven't looked into it. If you're confident, just merge it. |
|
OK, let's merge it, then. |
The problem was introduced in patch for Bug 541635, which accidentally ignored calculated `dragging` variable, causing drag to begin immediately when mouse is moved. Also, it introduced a crazy loop, which, if it proceeds to second iteration, will loop forever, because GTK events can't be processed when main thread is busy running the infinite loop. Luckily, it seems that the loop always exited on first iteration, and its meaning was simply to `return false` when mouse is not down. The reason why drag&drop can become stuck is not exactly clear, but I'm confident that it was related to very short drag&drop mouse move threshold (basically, 1px). With the regular threshold, the bug may still be present, but it's almost impossible to reproduce. The real case behind this bug is that when actual human double-clicks a TreeItem, sometimes mouse will be moved very slightly when doing so, which started a drag&drop, which got stuck and caused further problems in applications which were puzzled by never ending drag&drop. Also, it results in `TreeDragSourceEffect` image leak, because it never receives the drag end event. Signed-off-by: Alexandr Miloslavskiy <[email protected]>
d1c274e to
1234b88
Compare
Fixes #247
The problem was introduced in patch for Bug 541635, which accidentally
ignored calculated
draggingvariable, causing drag to beginimmediately when mouse is moved.
Also, it introduced a crazy loop, which, if it proceeds to second
iteration, will loop forever, because GTK events can't be processed when
main thread is busy running the infinite loop. Luckily, it seems that
the loop always exited on first iteration, and its meaning was simply to
return falsewhen mouse is not down.The reason why drag&drop can become stuck is not exactly clear, but I'm
confident that it was related to very short drag&drop mouse move
threshold (basically, 1px). With the regular threshold, the bug may
still be present, but it's almost impossible to reproduce.
The real case behind this bug is that when actual human double-clicks a
TreeItem, sometimes mouse will be moved very slightly when doing so,
which started a drag&drop, which got stuck and caused further problems
in applications which were puzzled by never ending drag&drop. Also, it
results in
TreeDragSourceEffectimage leak, because it never receivesthe drag end event.