Skip to content

wacom: Use the GDK Wayland device node path on Wayland - #473

Open
ArekMiszcz wants to merge 1 commit into
linuxmint:masterfrom
ArekMiszcz:wacom-wayland-device-path
Open

ArekMiszcz wants to merge 1 commit into
linuxmint:masterfrom
ArekMiszcz:wacom-wayland-device-path

Conversation

@ArekMiszcz

Copy link
Copy Markdown

Problem

In a Cinnamon Wayland session with a tablet connected (Wacom Intuos S 2 here), csd-wacom segfaults right after every login, and cinnamon-session gives up respawning it:

csd-wacom: segfault at 200000001 ... error 6 in libX11.so.6
#0 libX11.so.6
#1 XInternAtom
#2 xdevice_get_device_node        (plugins/common/csd-input-helper.c)
#3 get_device_path / is_opaque_tablet (plugins/wacom/csd-wacom-manager.c)
#4 migrate_tablet_settings ← device_added_cb ← add_devices

Cause

The wacom plugin does not force the X11 GDK backend, so on Wayland its GdkDevices are Wayland devices. get_device_path() still goes through gdk_x11_device_get_id() and xdevice_get_device_node(), which use the Wayland GdkDisplay as an X11 Display.

Fix

  • For a Wayland device, return gdk_wayland_device_get_node_path().
  • In is_opaque_tablet(), do not pass a NULL path to libwacom, and free the path afterwards (it was leaked).

The X11 code path is unchanged.

Testing

  • Applies to master; the change compiles there.
  • Backported to 6.4.3 on Debian 13 in a Cinnamon Wayland session with the tablet connected: csd-wacom starts, stays up and owns org.cinnamon.SettingsDaemon.Wacom. Before, it crashed within a second of starting.
  • Not re-tested in an X11 session, since that path did not change.

🤖 Generated with Claude Code

get_device_path() always went through xdevice_get_device_node() and
gdk_x11_device_get_id(). The wacom plugin does not force the X11 GDK
backend, so on Wayland this treats a Wayland GdkDisplay as an X11
Display and csd-wacom segfaults in XInternAtom as soon as a tablet is
present.

Use gdk_wayland_device_get_node_path() for Wayland devices, do not hand
a NULL path to libwacom, and free the path, which was leaked.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant