Cleanup previous PR

This commit is contained in:
Kovid Goyal
2026-01-15 19:26:27 +05:30
parent 6436cda482
commit 0d0ee5474d
2 changed files with 7 additions and 9 deletions

10
glfw/x11_init.c vendored
View File

@@ -178,21 +178,18 @@ read_xi_scroll_devices(void) {
bool is_finger_based = false; bool is_finger_based = false;
// Method 1: Check for libinput tapping support (touchpads only) // Method 1: Check for libinput tapping support (touchpads only)
Atom tapping_atom = XInternAtom(_glfw.x11.display, "libinput Tapping Enabled", False); if (_glfw.x11.xi.LIBINPUT_TAPPING != None) {
if (tapping_atom != None) {
Atom tapping_type; Atom tapping_type;
int tapping_format; int tapping_format;
unsigned long tapping_nitems, tapping_bytes; unsigned long tapping_nitems, tapping_bytes;
unsigned char *tapping_data = NULL; unsigned char *tapping_data = NULL;
if (XIGetProperty(_glfw.x11.display, device->deviceid, if (XIGetProperty(_glfw.x11.display, device->deviceid,
tapping_atom, 0, 1, False, AnyPropertyType, _glfw.x11.xi.LIBINPUT_TAPPING, 0, 1, False, AnyPropertyType,
&tapping_type, &tapping_format, &tapping_nitems, &tapping_type, &tapping_format, &tapping_nitems,
&tapping_bytes, &tapping_data) == Success) { &tapping_bytes, &tapping_data) == Success) {
if (tapping_data) { if (tapping_data) {
if (tapping_nitems > 0) { if (tapping_nitems > 0) is_finger_based = true;
is_finger_based = true;
}
XFree(tapping_data); XFree(tapping_data);
} }
} }
@@ -545,6 +542,7 @@ static bool initExtensions(void)
XInternAtom(_glfw.x11.display, "_MOTIF_WM_HINTS", False); 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_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(); read_xi_scroll_devices();
// Select XI_HierarchyChanged events to detect device add/remove // Select XI_HierarchyChanged events to detect device add/remove

2
glfw/x11_platform.h vendored
View File

@@ -427,7 +427,7 @@ typedef struct _GLFWlibraryX11
XIScrollDevice scroll_devices[16]; XIScrollDevice scroll_devices[16];
unsigned num_scroll_devices; unsigned num_scroll_devices;
int master_pointer_id; int master_pointer_id;
Atom LIBINPUT_SCROLL_METHOD_ENABLED; Atom LIBINPUT_SCROLL_METHOD_ENABLED, LIBINPUT_TAPPING;
} xi; } xi;
struct { struct {