Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Linux] [KDE Plasma] onDragEntered and onDragUpdated triggered when user come back from another window #324

Closed
sun-jiao opened this issue Mar 24, 2024 · 2 comments · Fixed by #325

Comments

@sun-jiao
Copy link
Contributor

A clear and concise description of what the bug is.

Reproduce Steps

Steps to reproduce the behavior:

  1. Click another window
  2. Move the cursor back to flutter app
  3. Click the DropTarget
  4. onDragEntered or onDragUpdated is triggered.

Expected behavior

A single click should not trigger anything.

Version (please complete the following information):

  • Flutter Version: 3.19.4
  • OS: Linux
  • plugin: desktop_drop: 0.4.4
desktop_drop_example.mp4
@sun-jiao
Copy link
Contributor Author

Screenshot_20240325_000227

Tested on the example of master branch.

No matter which one is clicked, callbacks are only triggered in the just last used one.

@sun-jiao
Copy link
Contributor Author

sun-jiao commented Mar 24, 2024

Seems this is a GTK or KDE bug: https://gitlab.gnome.org/GNOME/gtk/-/issues/5519 https://bugs.kde.org/show_bug.cgi?id=464196

While I think there still be some workaround in this flutter plugin, for example: clear previous _offset on the "focus-in-event" signal, and do not call _notifyEvent on the following first "drag-motion" signal.

Of course, this will lead to an obvious side effect. When the cursor just enters DropTarget, UI will not change. Only when the cursor moves slightly within DropTarget, UI will be updated.

However, manual operations by human could trigger drag-motion very frequently, and I think the latency of UI update is almost imperceptible to human users. And for users performing bulk actions using automated mouse emulators, UI updates is not important.

@sun-jiao sun-jiao changed the title onDragEntered and onDragUpdated triggered when user come back from another windows and click the DropTarget onDragEntered and onDragUpdated triggered when user come back from another window Mar 24, 2024
@sun-jiao sun-jiao changed the title onDragEntered and onDragUpdated triggered when user come back from another window [onDragEntered and onDragUpdated triggered when user come back from another window Mar 24, 2024
@sun-jiao sun-jiao changed the title [onDragEntered and onDragUpdated triggered when user come back from another window [Linux] [KDE Plasma] onDragEntered and onDragUpdated triggered when user come back from another window Mar 24, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant