Commit graph

42 commits

Author SHA1 Message Date
Simon Ser
ee70932422 backend/libinput: use NULL to indicate missing device name
libinput guarantees that the name is non-NULL, and an empty string
if unset. However wlroots uses NULL to indicate that an input device
name is unset.
2024-02-29 12:08:02 +01:00
Simon Ser
488a23c169 pointer: drop enum wlr_axis_orientation
Instead, use enum wl_pointer_axis from the Wayland protocol.
2024-02-28 16:39:18 +00:00
Simon Ser
ec5263e6b7 pointer: drop enum wlr_axis_relative_direction
Instead, use enum wl_pointer_axis_relative_direction from the
Wayland protocol.
2024-02-28 16:39:18 +00:00
Simon Ser
812451cd8f pointer: use enum wl_pointer_button_state 2024-02-28 16:39:18 +00:00
Simon Ser
9f4cf242d9 pointer: drop enum wlr_axis_source
Instead, use enum wl_pointer_axis_source from the Wayland protocol.
2024-02-28 16:39:18 +00:00
Simon Ser
7a58f41416 backend/libinput: populate pointer axis relative direction 2024-01-23 08:37:29 +00:00
Simon Ser
2d9659d765 backend/libinput: use struct initializers for events
This is more readable and consistent with the rest of wlroots.
2023-06-14 15:20:41 +02:00
Simon Ser
e1c6801b65 backend/libinput: ignore multiple events for same pointer button
If the same button is pressed on two devices on the same seat,
ignore the second event.

This is also what Mutter does.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3665
2023-06-14 10:48:44 +00:00
Simon Ser
86fc2199f8 build: unify naming for HAVE_* defines
We sometimes used HAS_, sometimes polluted the LIBINPUT_ namespace,
etc.
2022-12-06 22:39:45 +00:00
Alexander Orzechowski
ef4baea0e2 Use wl_signal_emit_mutable 2022-08-18 07:16:16 -04:00
José Expósito
e00f042f80 backend/libinput: code style consistency
Reduce a level of identation in "handle_pointer_axis" to keep the
consistency with "handle_pointer_axis_value120".
2022-07-11 11:01:35 +02:00
José Expósito
c6032d6b1c backend/libinput: handle high-res scroll events
On newer versions of libinput, the event LIBINPUT_EVENT_POINTER_AXIS
has been deprecated in favour of LIBINPUT_EVENT_POINTER_SCROLL_WHEEL,
LIBINPUT_EVENT_POINTER_SCROLL_FINGER and
LIBINPUT_EVENT_POINTER_SCROLL_CONTINUOUS.

Where new events are provided by the backend, ignore
LIBINPUT_EVENT_POINTER_AXIS, receive high-resolution scroll events from
libinput and emit the appropiate wlr_pointer signal.
2022-07-11 11:01:35 +02:00
José Expósito
65c436407f pointer: transform low-res to high-res axis events
Currently, the "wlr_event_pointer_axis" event stores low-resolution
values in its "delta_discrete" field. Low-resolution values are always
multiples of one, i.e., 1 for one wheel detent, 2 for two wheel
detents, etc.

In order to simplify internal handling of events, always transform in
the backend from the low-resolution value into the high-resolution
value.

The transformation is performed by multiplying by 120. The 120 magic
number is used by the kernel and it is exposed to clients in the
"WLR_POINTER_AXIS_DISCRETE_STEP" constant.
2022-07-11 11:01:35 +02:00
Simon Zeni
bd6c000d14 types/wlr_pointer: uniformize events name 2022-03-17 18:16:14 +00:00
Simon Zeni
51cd3c0726 interface/wlr_pointer: rework destroy sequence
The destroy callback in wlr_pointer_impl has been removed. The function
`wlr_pointer_finish` has been introduced to clean up the resources owned by a
wlr_pointer.

`wlr_input_device_destroy` no longer destroys the wlr_pointer, attempting to
destroy a wlr_pointer will result in a no-op.

The field `name` has been added to the wlr_pointer_impl to be able to identify
a given wlr_pointer device.
2022-03-07 16:37:41 +00:00
Simon Zeni
d60cdad3ea backend/libinput: rework pointer interface
The wlr_libinput_input_device now owns its wlr_pointer, instead of creating
a new wlr_libinput_input_device for it
2022-03-02 18:18:05 +00:00
Simon Zeni
91ba28e020 backend/libinput: remove wlr_input_device_impl 2022-02-21 16:48:43 -05:00
Simon Zeni
d5480efc7a types/wlr_pointer: add base wlr_input_device
wlr_pointer owns its wlr_input_device. It will be initialized when the
pointer is initialized, and finished when the pointer is destroyed.
2022-02-21 17:11:32 +00:00
José Expósito
52d2491931 backend/libinput: send hold gesture events
Receive hold gesture events from libinput and emit the appropiate
wlr_pointer signal.
2021-09-27 15:30:31 +02:00
Greg V
9fe8e37961 Implement the pointer-gestures-unstable-v1 protocol
This protocol relays touchpad gesture events produced by libinput to
supporting clients (e.g. Evince, Eye of GNOME).
2019-01-28 22:06:36 +01:00
emersion
5de26ad8ed
pointer: add a frame event
Frame events group logically connected pointer events. It makes sense to make
the backend responsible for sending frame events, since once the events are
split (ie. once the frame events are stripped) it's not easy to figure out
which events belongs to which frame again.

This is also how Weston handles frame events.

Fixes https://github.com/swaywm/wlroots/issues/1468
2019-01-26 11:04:05 +01:00
Alex Maese
e276d310e8 Add unaccelerated pointer values to wlr_event_pointer_motion events 2018-12-21 12:20:48 -06:00
emersion
7cbef15206
util: add wlr_ prefix to log symbols 2018-07-09 22:49:54 +01:00
emersion
0b58579564
Add support for discrete axis values 2018-05-12 13:34:58 +01:00
emersion
71ca45e2c0
Make sure we don't use others' prefixes 2018-04-25 23:24:58 +01:00
emersion
b0d99f5c67
Remove wlr_ prefix from local symbols 2018-04-25 23:00:46 +01:00
Drew DeVault
a35a5786b0 Remove width_mm from wlr_pointer events 2018-03-28 10:46:50 -04:00
emersion
c2e1474010
Reformat all #include directives 2018-02-12 21:29:23 +01:00
emersion
36ead80cd1
Make wlr_signal_emit_safe private 2018-02-12 19:52:47 +01:00
emersion
5e58d46cc1
Add wlr_signal_emit_safe 2018-02-12 09:12:31 +01:00
Tony Crisci
875a5b446f remove time usec 2017-10-30 15:43:06 -04:00
Tony Crisci
a224e74fad refactor input time_sec to time_msec 2017-10-30 06:40:06 -04:00
D.B
7cdc19d57f Fix duplicated pointer axis events
In pointer.c, some axis event was emitted even if the event pointer did not have
current axis.

In X11 backend pointer scroll events seem to be composed of both BUTTON_PRESS
and BUTTON_RELEASE. Therefore we should skip one of them (RELEASE) to avoid
event duplication.
2017-10-14 07:29:23 +02:00
Tony Crisci
98f4cdfccb implement wlr_cursor_map_input_to_output 2017-08-26 08:32:11 -04:00
Dominique Martinet
53e7bebd23 Refactor out wlr_pointer_state 2017-08-14 16:22:31 +02:00
Dominique Martinet
5c82d2f5c3 libinput backend: massive renaming
- 'libinput' (backend's) to libinput_context
- 'device' (libinput_device) to libinput_dev
- 'dev' (wlr_device) to wlr_dev
- 'devices' lists tangling of libinput devices to wlr_devices
- 'devices' list of wlr_devices in backend state to wlr_device_lists
2017-08-13 08:18:05 +02:00
Dominique Martinet
0663b6d1e1 Build libinput events on the stack instead of allocating 2017-08-11 18:38:27 +02:00
Scott Anderson
cb4d50e22c Changed header paths. 2017-08-06 13:25:26 +12:00
Drew DeVault
3d71969b2a Make event names consistent 2017-06-21 14:07:09 -04:00
Drew DeVault
f4453d104d Reorganize wlr-common 2017-06-21 12:10:07 -04:00
Drew DeVault
fd91244e83 Update everyone to use new headers 2017-06-21 10:27:45 -04:00
Drew DeVault
a63230e59c Implement libinput wlr_pointer 2017-06-13 11:05:45 -04:00