wlroots-hyprland/types
Rouven Czerwinski 988fe5bda9 relative_pointer: handle inert pointer objects
Since 5e0ef70cc0 ("seat: Create inert objects for missing capabilities")
wlroots can create inert seat objects when the capability is currently missing
for the client but it had the capablity before. The client hoever will happily
handover the wl_pointer resource to the relative_pointer implementation,
creating a NULL pointer dereference when trying to access the seat_client which
is set to NULL for inert objects.

Since the protocol does not contain an error for such requests, we hand out an
relative_pointer handle with the seat set to NULL.
We also need to check whether there is an associated seat in
send_relative_motion and need to tweak the destroy notifier in case no seat is
available.

This way we can hand out a valid relative_pointer resource and don't crash the
compositor when trying to access an inert seat pointer resource in
relative_pointer.

Relevant WAYLAND_DEBUG=1 when testing a client and switching VT every second:
[2619872.442] wl_seat@30.capabilities(3)
[2619872.460]  -> wl_seat@30.get_pointer(new id wl_pointer@36)
[2619872.484] wl_data_device@25.selection(nil)
[2619872.504] zwp_primary_selection_device_v1@26.selection(nil)
[2619874.995] wl_seat@12.capabilities(3)
[2619875.035]  -> wl_compositor@5.create_surface(new id wl_surface@37)
[2619875.088]  -> wl_seat@12.get_pointer(new id wl_pointer@29)
[2619875.105]  -> zwp_relative_pointer_manager_v1@8.get_relative_pointer(new id zwp_relative_pointer_v1@27, wl_pointer@29)
[2619875.127]  -> wl_compositor@5.create_surface(new id wl_surface@35)
[2619875.139]  -> wl_seat@12.get_pointer(new id wl_pointer@43)
[2619981.180] wl_seat@12.capabilities(2)
[2619981.214]  -> zwp_relative_pointer_v1@27.destroy()
[2619981.226]  -> wl_pointer@29.release()
[2619981.236]  -> wl_surface@37.destroy()
[2619981.247]  -> wl_pointer@43.release()
[2619981.254]  -> wl_surface@35.destroy()
[2619981.262] wl_seat@12.capabilities(0)
[2619981.285]  -> wl_keyboard@33.release()
[2619987.316] wl_seat@30.capabilities(2)
[2619987.336]  -> wl_pointer@36.release()
[2619987.363] wl_seat@30.capabilities(0)
[2619987.371]  -> wl_keyboard@34.release()
[2621932.880] wl_display@1.delete_id(41)
[2621932.903] wl_display@1.delete_id(40)
[2621932.910] wl_display@1.delete_id(27)
[2621932.917] wl_display@1.delete_id(29)
[2621932.924] wl_display@1.delete_id(37)
[2621932.930] wl_display@1.delete_id(43)
[2621932.944] wl_display@1.delete_id(35)
[2621932.950] wl_display@1.delete_id(33)
[2621932.959] wl_seat@12.capabilities(2)
[2621932.976]  -> wl_seat@12.get_keyboard(new id wl_keyboard@33)
[2621936.875] wl_seat@12.capabilities(3)
[2621936.893]  -> wl_compositor@5.create_surface(new id wl_surface@35)
[2621936.931]  -> wl_seat@12.get_pointer(new id wl_pointer@43)
[2621936.945]  -> zwp_relative_pointer_manager_v1@8.get_relative_pointer(new id zwp_relative_pointer_v1@37, wl_pointer@43)
[2621936.965]  -> wl_compositor@5.create_surface(new id wl_surface@29)
[2621936.987]  -> wl_seat@12.get_pointer(new id wl_pointer@27)
[2621942.796] wl_data_device@25.selection(nil)
[2621942.817] zwp_primary_selection_device_v1@26.selection(nil)
[2621942.823] wl_seat@30.capabilities(2)
2022-05-30 14:10:22 +00:00
..
data_device Zero-initialize structs in init functions 2022-04-28 10:09:50 +02:00
output output: add wlr_output_commit_state 2022-05-30 11:40:34 +02:00
scene xdg-popup: use current/pending state pattern 2022-05-27 13:31:30 +00:00
seat seat: Allow to cancel touches 2022-05-22 09:43:33 +00:00
tablet_v2 types/wlr_tablet_tool: remove name ambiguity 2022-03-11 11:49:41 +01:00
xdg_shell xdg-shell: bump version to 3 2022-05-27 13:31:30 +00:00
meson.build wlr_scene: Refactor wlr_scene_surface to be a helper on top of wlr_scene_buffer 2022-05-19 14:26:50 -04:00
wlr_buffer.c Zero-initialize structs in init functions 2022-04-28 10:09:50 +02:00
wlr_compositor.c Zero-initialize structs in init functions 2022-04-28 10:09:50 +02:00
wlr_cursor.c types/wlr_touch: uniformize events name 2022-03-17 18:16:14 +00:00
wlr_data_control_v1.c Simplify globals implementation by removing destructors 2019-11-25 09:01:46 -05:00
wlr_drm.c buffer: extract interface to separate header 2022-03-03 15:39:05 +01:00
wlr_drm_lease_v1.c drm-lease-v1: skip device on wlr_drm_backend_get_non_master_fd failure 2022-05-02 15:44:16 +00:00
wlr_export_dmabuf_v1.c export-dmabuf-v1: use wlr_output_event_commit.buffer 2021-12-03 14:56:17 +00:00
wlr_foreign_toplevel_management_v1.c foreign-toplevel: send enter if needed on output bind 2022-01-17 19:11:08 +01:00
wlr_fullscreen_shell_v1.c surface: deprecate wlr_surface.h 2022-01-13 10:06:41 +00:00
wlr_gamma_control_v1.c gamma-control-v1: schedule frame when resetting gamma LUT 2021-01-10 18:40:08 +01:00
wlr_idle.c Simplify globals implementation by removing destructors 2019-11-25 09:01:46 -05:00
wlr_idle_inhibit_v1.c surface: deprecate wlr_surface.h 2022-01-13 10:06:41 +00:00
wlr_input_device.c Zero-initialize structs in init functions 2022-04-28 10:09:50 +02:00
wlr_input_inhibitor.c Make implementation function lists static const 2021-02-05 10:04:20 +01:00
wlr_input_method_v2.c types/wlr_keyboard: remove destroy event 2022-03-11 20:02:21 +00:00
wlr_keyboard.c Zero-initialize structs in init functions 2022-04-28 10:09:50 +02:00
wlr_keyboard_group.c types/wlr_keyboard: uniformize events name 2022-03-17 18:16:14 +00:00
wlr_keyboard_shortcuts_inhibit_v1.c surface: deprecate wlr_surface.h 2022-01-13 10:06:41 +00:00
wlr_layer_shell_v1.c xdg-popup: use current/pending state pattern 2022-05-27 13:31:30 +00:00
wlr_linux_dmabuf_v1.c linux-dmabuf-v1: fix MOD_INVALID handling in feedback tranches 2022-05-26 13:45:24 +00:00
wlr_matrix.c move wlr_box from /types to /util 2021-07-06 21:43:17 +02:00
wlr_output_damage.c output: add wlr_output_event_precommit.state 2022-05-30 11:34:57 +02:00
wlr_output_layout.c wlr_output_layout_contains_point: handle outputs that aren't in the layout 2022-03-11 06:49:49 +00:00
wlr_output_management_v1.c output: turn make/model/serial into char * 2022-05-26 13:36:06 +00:00
wlr_output_power_management_v1.c output-power-management-v1: listen to output commit 2020-08-27 13:54:19 -06:00
wlr_pointer.c Zero-initialize structs in init functions 2022-04-28 10:09:50 +02:00
wlr_pointer_constraints_v1.c surface: deprecate wlr_surface.h 2022-01-13 10:06:41 +00:00
wlr_pointer_gestures_v1.c types/wlr_pointer_gestures_v1.c: get client from seat client instead of resource 2022-04-16 20:53:52 +02:00
wlr_presentation_time.c surface: deprecate wlr_surface.h 2022-01-13 10:06:41 +00:00
wlr_primary_selection.c Zero-initialize structs in init functions 2022-04-28 10:09:50 +02:00
wlr_primary_selection_v1.c primary selection: destroy devices before manager 2021-01-05 13:53:58 +01:00
wlr_region.c region: stabilize interface 2021-07-05 09:25:25 -04:00
wlr_relative_pointer_v1.c relative_pointer: handle inert pointer objects 2022-05-30 14:10:22 +00:00
wlr_screencopy_v1.c output: add wlr_output_event_precommit.state 2022-05-30 11:34:57 +02:00
wlr_server_decoration.c surface: deprecate wlr_surface.h 2022-01-13 10:06:41 +00:00
wlr_session_lock_v1.c ext-session-lock-v1: new protocol implementation 2022-02-02 15:22:02 +01:00
wlr_subcompositor.c subsurface: unlock cached state on commit if desynced 2022-01-25 22:41:30 +03:00
wlr_switch.c Zero-initialize structs in init functions 2022-04-28 10:09:50 +02:00
wlr_tablet_pad.c Zero-initialize structs in init functions 2022-04-28 10:09:50 +02:00
wlr_tablet_tool.c Zero-initialize structs in init functions 2022-04-28 10:09:50 +02:00
wlr_text_input_v3.c surface: deprecate wlr_surface.h 2022-01-13 10:06:41 +00:00
wlr_touch.c Zero-initialize structs in init functions 2022-04-28 10:09:50 +02:00
wlr_viewporter.c surface: deprecate wlr_surface.h 2022-01-13 10:06:41 +00:00
wlr_virtual_keyboard_v1.c types/wlr_keyboard: uniformize events name 2022-03-17 18:16:14 +00:00
wlr_virtual_pointer_v1.c types/wlr_pointer: uniformize events name 2022-03-17 18:16:14 +00:00
wlr_xcursor_manager.c Make wlr_xcursor_manager_load() return a bool 2020-05-18 16:48:44 +02:00
wlr_xdg_activation_v1.c xdg-activation: Deduplicate token creation code 2022-03-26 17:28:51 +01:00
wlr_xdg_decoration_v1.c xdg-toplevel: fix functions' main argument type 2022-02-02 21:06:11 +03:00
wlr_xdg_foreign_registry.c util/uuid: replace with util/token, remove libuuid 2021-04-11 19:09:36 +02:00
wlr_xdg_foreign_v1.c xdg-foreign-v1: treat unmapped parents as NULL 2022-04-13 16:48:15 +00:00
wlr_xdg_foreign_v2.c xdg-foreign-v2: treat unmapped parents as NULL 2022-04-13 16:48:15 +00:00
wlr_xdg_output_v1.c xdg-output: remove dead code 2022-01-28 17:38:39 +01:00