diff --git a/glfw/x11_init.c b/glfw/x11_init.c index 00985057c..f51afb400 100644 --- a/glfw/x11_init.c +++ b/glfw/x11_init.c @@ -178,21 +178,18 @@ read_xi_scroll_devices(void) { bool is_finger_based = false; // Method 1: Check for libinput tapping support (touchpads only) - Atom tapping_atom = XInternAtom(_glfw.x11.display, "libinput Tapping Enabled", False); - if (tapping_atom != None) { + if (_glfw.x11.xi.LIBINPUT_TAPPING != None) { Atom tapping_type; int tapping_format; unsigned long tapping_nitems, tapping_bytes; unsigned char *tapping_data = NULL; - - if (XIGetProperty(_glfw.x11.display, device->deviceid, - tapping_atom, 0, 1, False, AnyPropertyType, + + if (XIGetProperty(_glfw.x11.display, device->deviceid, + _glfw.x11.xi.LIBINPUT_TAPPING, 0, 1, False, AnyPropertyType, &tapping_type, &tapping_format, &tapping_nitems, &tapping_bytes, &tapping_data) == Success) { if (tapping_data) { - if (tapping_nitems > 0) { - is_finger_based = true; - } + if (tapping_nitems > 0) is_finger_based = true; XFree(tapping_data); } } @@ -545,6 +542,7 @@ static bool initExtensions(void) XInternAtom(_glfw.x11.display, "_MOTIF_WM_HINTS", False); _glfw.x11.xi.LIBINPUT_SCROLL_METHOD_ENABLED = XInternAtom(_glfw.x11.display, "libinput Scroll Method Enabled", False); + _glfw.x11.xi.LIBINPUT_TAPPING = XInternAtom(_glfw.x11.display, "libinput Tapping Enabled", False); read_xi_scroll_devices(); // Select XI_HierarchyChanged events to detect device add/remove diff --git a/glfw/x11_platform.h b/glfw/x11_platform.h index 6c2fb25b8..1a7aed95e 100644 --- a/glfw/x11_platform.h +++ b/glfw/x11_platform.h @@ -427,7 +427,7 @@ typedef struct _GLFWlibraryX11 XIScrollDevice scroll_devices[16]; unsigned num_scroll_devices; int master_pointer_id; - Atom LIBINPUT_SCROLL_METHOD_ENABLED; + Atom LIBINPUT_SCROLL_METHOD_ENABLED, LIBINPUT_TAPPING; } xi; struct {