-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Full drawing tablet support. #4570
Conversation
bb4485b
to
493c50b
Compare
OK, this is probably close to ready for review at this point. This ended up being rather large, so it is possible it may make sense to split some of the work into separate commits/PRs, but I was having trouble deciding how exactly to split it, so I left it as-is for now. |
This looks pretty good overall. From testing:
I have one of these, for this express purpose :) tilt and ring both works, but I found that mode switching events are not sent to clients. |
Segfault:
|
Thanks for testing! I will take a look at these tonight. I think set cursor has the least thought put into it, it’s mostly the code from rootston, probably some bad assumptions. I didn’t notice many issues but I think my testing was probably not thorough enough. TODO
|
493c50b
to
aae5de3
Compare
Last night I added support for pen buttons with fallback. The fallback just maps all of them to right button like it did before. I am also working to reproduce the crash that occurs when a surface is destroyed. Do you have any idea how to reproduce? I think it is most likely safe to simply not send the leave event if the surface is being destroyed, but I wasn’t sure if that would cause any weird edge cases, and in testing it never seemed to cause any memory/crashing issues for me.
|
I think what I had done was open Xournalpp, mess around with it, then closed it. Or maybe SIGINT'd it. One common mistake with this stuff is to tear down the listener without setting it back up again - make sure to wl_list_init afterwards. |
Tested again, everything seems to be working pretty well. |
Famous last words. Hotplugging a tablet gave me this:
|
Oh, oops. I think I have that one fixed locally and just haven’t pushed it up yet. If I remember correctly, I just forgot to unlink the tablet pad on destroy, so when it scans for tablet pads it does a use after free. |
sway/input/cursor.c
Outdated
&surface, &sx, &sy); | ||
|
||
// TODO: is this how the fallback check should work? Should this be kept | ||
// track of elsewhere? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style issues fixed and this is 👍 from me
Rebase? |
Squash, rather |
Yeah, I'll squash it, hang on a sec. |
Sway has basic support for drawing tablets, but does not expose properties such as pressure sensitivity. This implements the wlr tablet v2 protocol, providing tablet events to Wayland clients.
04f6096
to
1ce052d
Compare
Thanks! |
This implements the wlr tablet v2 protocol, including fallback events for surfaces that do not support it. This is mostly based on the code in Rootston, but differs enough thanks to Sway's input system being reasonably different from Rootston's.
Most things seem to work correctly at this point. I do not own a tablet with certain features (like tilt, or a ring) so I can not test all functionality.
Applications tested:
Fixes #2288.