linebender / druid

A data-first Rust-native UI design toolkit.
https://linebender.org/druid/
Apache License 2.0
9.45k stars 569 forks source link

Extremely inconsistent click-drag behaviour #2344

Closed cbondurant closed 1 year ago

cbondurant commented 1 year ago

I was testing the modal window example, and found that clicking and dragging was extremely inconsistent in a very strange way. Example

I have actually had similar behavior to this while attempting to work on a general graphics canvas widget for my project Lipuma. At the time I thought it was due to a misunderstanding of mine but now it seems that it might be deeper than that.

In terms of platform I have currently tested this using i3 as my window manager on X11. It's late as I'm writing this, and I will double check this with KDE Plasma tomorrow morning.

cbondurant commented 1 year ago

I just confirmed that the same behavior occurs under cinnamon and KDE Plasma.

cbondurant commented 1 year ago

I have identified the problem: The debug output used to print out all of the move events was causing handling the event to take so long that the event loop was failing to keep up.

This doesn't explain the jitter I've been dealing with in Lipuma, but before this incident I had assumed it was my code anyways. Closing as user error.

jneem commented 1 year ago

I think maybe we should change the example... it's demonstrating how to set the child position programmatically, but this definitely isn't the right way to have a moveable child window.