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

Correct relative mouse input handling #634

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

necessarily-equal
Copy link
Contributor

Closes #600. Hopefully for good this time.

@necessarily-equal
Copy link
Contributor Author

I've tested this to work on SDL2.0.20, SDL2.0.22 and SDL main branch (as of libsdl-org/SDL@3807e95).

Testing with old SDL versions is left as an exercise for the reader ;-)

@slipher
Copy link
Member

slipher commented Jun 13, 2022

This patch breaks Mac by making it impossible to move the mouse outside the window. This is true with both SDL 2.0.12 and latest SDL.

Closes DaemonEngine#600. Hopefully for
good this time.
@necessarily-equal
Copy link
Contributor Author

@bmorel since you seem to use a minimalist X11 setup, you may want to try to see if this PR don't introduce some regression on your setup.

// work around X window managers and edge-based workspace flipping
// - without this, we get LeaveNotify, no mouse button events, EnterNotify;
//   we would likely miss some button presses and releases.
IN_CenterMouse();

I'd say you don't really have to try it either, you can also complain afterwards ;)

@slipher
Copy link
Member

slipher commented Jun 13, 2022

The workspace flipping thing described in the comment seems to be an xfce behavior. https://askubuntu.com/questions/891859/xubuntu-snap-to-window-switching-workspaces

@necessarily-equal necessarily-equal merged commit dc8b702 into DaemonEngine:master Jun 17, 2022
@necessarily-equal
Copy link
Contributor Author

Tested working by @IngarKCT. It also works for me and it fix a problem that totally breaks the game, so I'm merging this.

I'll have a look at the XFCE situation a bit later, to check if it is still a problem.

@necessarily-equal necessarily-equal deleted the fix-sdl branch June 17, 2022 20:09
@necessarily-equal
Copy link
Contributor Author

necessarily-equal commented Jun 17, 2022 via email

@necessarily-equal
Copy link
Contributor Author

necessarily-equal commented Jun 19, 2022

@Viech it would be nice if you could backport this to the AUR

This patch should* apply: cleanly sdl.patch.txt (although it was hand-edited, and is untested)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SDL input is buggy in version 2.16 and later
2 participants