mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 09:15:57 +02:00
Cleanup previous PR
This commit is contained in:
14
glfw/x11_init.c
vendored
14
glfw/x11_init.c
vendored
@@ -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
|
||||
|
||||
2
glfw/x11_platform.h
vendored
2
glfw/x11_platform.h
vendored
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user