mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 16:37:27 +00:00
Ignore master pointer device events since we use the slave devices
This commit is contained in:
parent
1efded85bc
commit
da170555fa
3 changed files with 8 additions and 4 deletions
1
glfw/x11_init.c
vendored
1
glfw/x11_init.c
vendored
|
|
@ -160,6 +160,7 @@ read_xi_scroll_devices(void) {
|
|||
if (!devices) return;
|
||||
for (int i = 0; i < deviceCount; i++) {
|
||||
XIDeviceInfo* device = &devices[i];
|
||||
if (device->use == XIMasterPointer) _glfw.x11.xi.master_pointer_id = device->deviceid;
|
||||
if (device->use != XISlavePointer || !device->enabled) continue;
|
||||
Atom actual_type;
|
||||
int actual_format;
|
||||
|
|
|
|||
1
glfw/x11_platform.h
vendored
1
glfw/x11_platform.h
vendored
|
|
@ -425,6 +425,7 @@ typedef struct _GLFWlibraryX11
|
|||
PFN_XIGetProperty GetProperty;
|
||||
XIScrollDevice scroll_devices[16];
|
||||
unsigned num_scroll_devices;
|
||||
int master_pointer_id;
|
||||
Atom LIBINPUT_SCROLL_METHOD_ENABLED;
|
||||
} xi;
|
||||
|
||||
|
|
|
|||
10
glfw/x11_window.c
vendored
10
glfw/x11_window.c
vendored
|
|
@ -1407,10 +1407,12 @@ static void processEvent(XEvent *event)
|
|||
else if (event->xcookie.evtype == XI_Motion)
|
||||
{
|
||||
XIDeviceEvent* de = (XIDeviceEvent*)event->xcookie.data;
|
||||
// Find the window for this event
|
||||
_GLFWwindow* window = NULL;
|
||||
if (XFindContext(_glfw.x11.display, de->event, _glfw.x11.context, (XPointer*)&window) == 0)
|
||||
handle_xi_motion_event(window, de);
|
||||
if (de->deviceid != _glfw.x11.xi.master_pointer_id) {
|
||||
// Find the window for this event
|
||||
_GLFWwindow* window = NULL;
|
||||
if (XFindContext(_glfw.x11.display, de->event, _glfw.x11.context, (XPointer*)&window) == 0)
|
||||
handle_xi_motion_event(window, de);
|
||||
}
|
||||
}
|
||||
// Handle XI_HierarchyChanged for device hotplug
|
||||
else if (event->xcookie.evtype == XI_HierarchyChanged)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue