Skip to content
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

Failure to deliver mouse events outside of the window #541

Closed
cmyr opened this issue Feb 11, 2020 · 7 comments · Fixed by #552
Closed

Failure to deliver mouse events outside of the window #541

cmyr opened this issue Feb 11, 2020 · 7 comments · Fixed by #552
Labels
bug does not behave the way it is supposed to help wanted has no one working on it yet shell/gtk concerns the GTK backend

Comments

@cmyr
Copy link
Member

cmyr commented Feb 11, 2020

Druid expects to receive a mouse move event when the mouse moves outside of the window.

This currently is not delivered on the gtk backend. I haven't tested on windows, but I suspect it may have a similar problem.

It is not necessary that we receive all events outside the window, but it is pretty important that we receive at least one. On platforms that have mouse entered/exited notifications, it would be acceptable to handle that on the platform and send mouse_moved to druid-shell then.

@cmyr cmyr added bug does not behave the way it is supposed to help wanted has no one working on it yet shell/gtk concerns the GTK backend labels Feb 11, 2020
@cmyr cmyr changed the title Failure to deliver mouse events outside if the window Failure to deliver mouse events outside of the window Feb 11, 2020
@ForLoveOfCats
Copy link
Collaborator

Does the Cocoa backend send all mouse events when the point is outside the window bounds? It is pretty important for all backends to do that so that you can eg continue to drag scrollbars when the mouse leaves the window, but as the Cocoa is the current "gold standard" backend it would be good to get the behavior the same on GTK (and Windows if it is not already) then upgrade them all to send all mouse events if necessary.

@cmyr
Copy link
Member Author

cmyr commented Feb 14, 2020

These are slightly different issues: when a mouse button is pressed inside our window we want to capture all events, (see #457) but if the mouse is not pressed we only need to know if it has left the window.

Cocoa does just give us all the events while we are the frontmost window, but I don't think it is critical for other backends to emulate this exactly.

@raphlinus
Copy link
Contributor

I might not be understanding everything, but I think the issue here is when the mouse is pressed inside the window, then dragged away while the button is held down. I haven't validated this, but my impression is that macOS continues to deliver mouse events until button-up, while Windows does not do this by default, but does provide a SetCapture function that can provide this behavior.

@cmyr
Copy link
Member Author

cmyr commented Feb 14, 2020

that is a separate issue (#457). This is for knowing when the mouse has left the window when there is no mouse button pressed.

@raphlinus
Copy link
Contributor

Ah ok, disregard then.

@raphlinus
Copy link
Contributor

Do we want this to simply be a mousemoved event with coordinates outside the window, or do we want to have a separate mouseleave event that specifically indicates that? I believe that on Cocoa the right way to that is a mouseExited: event after setting up a tracking area.

@cmyr
Copy link
Member Author

cmyr commented Feb 14, 2020

things are working fine on cocoa, which always delivers mouse events to the active window. The easiest course of action is to just deliver a mousemoved event with coordinates outside the window on other platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug does not behave the way it is supposed to help wanted has no one working on it yet shell/gtk concerns the GTK backend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants