Ignore master pointer device events since we use the slave devices
This commit is contained in:
1
glfw/x11_init.c
vendored
1
glfw/x11_init.c
vendored
@@ -160,6 +160,7 @@ read_xi_scroll_devices(void) {
|
|||||||
if (!devices) return;
|
if (!devices) return;
|
||||||
for (int i = 0; i < deviceCount; i++) {
|
for (int i = 0; i < deviceCount; i++) {
|
||||||
XIDeviceInfo* device = &devices[i];
|
XIDeviceInfo* device = &devices[i];
|
||||||
|
if (device->use == XIMasterPointer) _glfw.x11.xi.master_pointer_id = device->deviceid;
|
||||||
if (device->use != XISlavePointer || !device->enabled) continue;
|
if (device->use != XISlavePointer || !device->enabled) continue;
|
||||||
Atom actual_type;
|
Atom actual_type;
|
||||||
int actual_format;
|
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;
|
PFN_XIGetProperty GetProperty;
|
||||||
XIScrollDevice scroll_devices[16];
|
XIScrollDevice scroll_devices[16];
|
||||||
unsigned num_scroll_devices;
|
unsigned num_scroll_devices;
|
||||||
|
int master_pointer_id;
|
||||||
Atom LIBINPUT_SCROLL_METHOD_ENABLED;
|
Atom LIBINPUT_SCROLL_METHOD_ENABLED;
|
||||||
} xi;
|
} 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)
|
else if (event->xcookie.evtype == XI_Motion)
|
||||||
{
|
{
|
||||||
XIDeviceEvent* de = (XIDeviceEvent*)event->xcookie.data;
|
XIDeviceEvent* de = (XIDeviceEvent*)event->xcookie.data;
|
||||||
// Find the window for this event
|
if (de->deviceid != _glfw.x11.xi.master_pointer_id) {
|
||||||
_GLFWwindow* window = NULL;
|
// Find the window for this event
|
||||||
if (XFindContext(_glfw.x11.display, de->event, _glfw.x11.context, (XPointer*)&window) == 0)
|
_GLFWwindow* window = NULL;
|
||||||
handle_xi_motion_event(window, de);
|
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
|
// Handle XI_HierarchyChanged for device hotplug
|
||||||
else if (event->xcookie.evtype == XI_HierarchyChanged)
|
else if (event->xcookie.evtype == XI_HierarchyChanged)
|
||||||
|
|||||||
Reference in New Issue
Block a user