-
Notifications
You must be signed in to change notification settings - Fork 568
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
Capture mouse on click #457
Comments
We could even send a mouse-up when the mouse leaves the window. That might be a solution for platforms that don't support mouse capture? |
Are there platforms that don't support mouse capture? Sending a mouse up sounds like it would cause other problems; what happens if the user drags briefly out off a button out of the window, then back onto the button and actually does mouse up? |
Hello - After reading thought the linked documents, For all other cases, this is what I've seen in the past:
Anyway. I hope this helps. |
Was this implemented on Linux? 🤔 |
It may not be. This issue had a particularly windows-y tone; if this remains an issue on GTK I'm happy for us to open a new platform-specific issue then. |
This is branched from #450, but has come up repeatedly, so I felt it needed its own issue.
Mouse move and up events are dropped when the mouse is clicked in window then dragged outside. This causes all kinds of problems, as widgets (reasonably) expect an eventual mouse up after a mouse down.
I think it needs to be solved at the druid-shell level. On Windows, we should be calling SetCapture (and ReleaseCapture). I'm not sure what the counterparts are on other systems; on macOS I think this may be handled by the platform.
When should the app grab mouse capture? One possibility is to always do this on mouse click. Another is to have it plumbed down from set_active (and there is a TODO in the source for this). If the behavior on macOS is to always capture, then I think the former route is more developer-friendly, as there's less risk of strange behavior when set_active is not called, and of course less platform variation.
The text was updated successfully, but these errors were encountered: