Commit Graph

25 Commits

Author SHA1 Message Date
Manuel Stoeckl a290d7a78d Make implementation function lists static const
This requires a change to the type of `struct wlr_tablet` and
`wlr_tablet_init` signature, both of which are part of the unstable API.
2021-02-05 10:04:20 +01:00
Tudor Brindus c9c31f803e util/time: de-duplicate `timespec_to_msec` 2020-06-06 00:09:19 +02:00
Simon Ser 1a23c1425f Add comments for missing tablet tool entries
And stop using default cases, so that we know which parts of the code
need an update when adding a new enum entry.

Closes: https://github.com/swaywm/wlroots/issues/2208
2020-05-28 15:13:05 +02:00
Simon Ser 781ed1ff02 Fix -Wreturn-type warnings
When calling assert(0) instead of returning a value, -Wreturn-type
warnings are triggered because assertions can be disabled. Replace these
assertions with abort().
2020-05-19 14:54:02 +02:00
Tudor Brindus 7693fdb8a7 tablet: expose wlr_tablet_tool_v2_has_implicit_grab function
This is necessary so that sway can determine when to start emulating
pointer events -- it shouldn't start doing so during an implicit grab,
even if the pen is over a surface that doesn't bind tablet input.

Refs swaywm/sway#5302.
2020-05-14 18:45:19 +02:00
Tudor Brindus 74c0d03f00 tablet: pass motion events to implicitly grabbed surface
Refs swaywm/sway#5302.
2020-05-14 18:45:19 +02:00
Tudor Brindus d698334620 input/tablet: clear focused surface on surface destroy
Otherwise, we can end up left with a dangling pointer to a
previously-focused, now-destroyed surface.

Fixes swaywm/sway#5264.
2020-04-30 12:08:42 +02:00
myfreeweb 774548696c Send tablet tool frame on proximity_out
Fixes GTK application crashes
2019-12-18 13:23:07 -05:00
Drew DeVault 94f65e354d Add libinput-1.14 support
This libinput version adds a new tablet tool type.
2019-08-11 19:39:47 +09:00
Manuel Stoeckl 1ef0c03a46 wlr_tablet_v2: Register event serials 2019-06-30 15:01:05 -04:00
Markus Ongyerth 09b2833dcd send proximity_out in proximity in for tablet_v2
When the proximity_in event is sent for tablet_v2 and there's already a
surface that currently has tablet (tool) focus, it should be told that
this is no longer the case, so we need to send the proximity_out event.
2019-03-31 20:16:03 +03:00
Markus Ongyerth fc9838b15e Prevent NULL dereference in tablet_tool handler
In case a tool was removed, but not yet destroyed by the client, the
tool_client's tool can be NULL. We have to check that as well in the
set_cursor handler to prevent using inert resources
2019-02-19 08:51:10 +01:00
emersion 0fafab87e3
Fix a few typos 2019-01-10 09:30:14 +01:00
Markus Ongyerth 21e1cc9ab4 Implement feedback 2018-09-08 19:17:44 +02:00
Markus Ongyerth 3ad7b146eb Fix typos/order in tablet-v2 2018-08-06 08:45:44 +02:00
Markus Ongyerth f64962ace8 tablet-v2 tool: Implement implicit grab
Implement the tablet-v2 tablet tool's implicit grab semantics for
buttons and tip.

This avoids losing focus (to other [sub]surfaces) when a button is held,
or the tip is down.
This should help when the device is used close to a surface's border and
would otherwise have to be very precise.
2018-08-06 08:45:41 +02:00
Markus Ongyerth d5950255de tablet-v2 tablet_tool grab implementation
Implement the basic logic for tablet-v2 tablet_tool's grabs. And plug in
the default grab.
2018-07-23 10:08:10 +02:00
Markus Ongyerth 9a6f77fc2c tablet-v2: fix merge commits and test again
There were a few issues after rebase, that the merge algorithm didn't
throw at my face:

wlr_output did a check on the actual role, not a string anymore, so that
had to go to allow tablet-v2 to set cursor surfaces.
A few L_DEBUG/L_ERRORs were still around
There was a user-after-free in tablet-group free()ing, probably after
insufficient testing from a previous feedback pass
2018-07-14 10:29:22 +02:00
Markus Ongyerth 74ca2f8fcf Another round of feedback from acrisci 2018-07-14 09:52:34 +02:00
Markus Ongyerth 43b20bfea2 First feedback pass from acrisci 2018-07-14 09:52:05 +02:00
Markus Ongyerth d9e978e1b3 rename wlr_tablet_tool to wlr_tablet
The previous naming was based on the input-device capability names from
libinput.
With code that uses the libinput_tablet_tool and mapping into tablet-v2,
this is confusing, so the name is changed to follow the names used in
the protocol.
2018-07-14 09:49:58 +02:00
Markus Ongyerth 2bc09d91c3 Silent conversion from double to int should be illegal 2018-07-14 09:48:57 +02:00
Markus Ongyerth dc525a9c5f Clean up serial handling and automate proximity acompaning events 2018-07-14 09:48:57 +02:00
Markus Ongyerth 25c2808153 Clean up serial handling 2018-07-14 09:48:57 +02:00
Markus Ongyerth fa39fd178d Split tablet_v2 implementation for easier maintainance 2018-07-14 09:48:57 +02:00