summaryrefslogtreecommitdiff
path: root/src/XExtInt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/XExtInt.c')
-rw-r--r--src/XExtInt.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/XExtInt.c b/src/XExtInt.c
index 811c0c3..e5baccb 100644
--- a/src/XExtInt.c
+++ b/src/XExtInt.c
@@ -122,7 +122,9 @@ XEXT_GENERATE_FIND_DISPLAY(XInput_find_display, xinput_info,
{XI_Present, XI_Add_XSetDeviceValuators_Major,
XI_Add_XSetDeviceValuators_Minor},
{XI_Present, XI_Add_XChangeDeviceControl_Major,
- XI_Add_XChangeDeviceControl_Minor}
+ XI_Add_XChangeDeviceControl_Minor},
+ {XI_Present, XI_Add_DevicePresenceNotify_Major,
+ XI_Add_DevicePresenceNotify_Minor}
};
/***********************************************************************
@@ -251,6 +253,14 @@ Ones(mask)
return (((y + (y >> 3)) & 030707070707) % 077);
}
+static int
+_XiGetDevicePresenceNotifyEvent(Display * dpy)
+{
+ XExtDisplayInfo *info = XInput_find_display(dpy);
+
+ return info->codes->first_event + XI_DevicePresenceNotify;
+}
+
/***********************************************************************
*
* Handle Input extension events.
@@ -665,6 +675,22 @@ XInputWireToEvent(dpy, re, event)
return (ENQUEUE_EVENT);
}
break;
+
+ case XI_DevicePresenceNotify:
+ {
+ XDevicePresenceNotifyEvent *ev = (XDevicePresenceNotifyEvent *) re;
+ devicePresenceNotify *ev2 = (devicePresenceNotify *) event;
+
+ fprintf(stderr, "got DevicePresenceNotify event (reltype=%d)\n",
+ reltype);
+
+ *ev = *(XDevicePresenceNotifyEvent *) save;
+ ev->window = 0;
+ ev->time = ev2->time;
+ return (ENQUEUE_EVENT);
+ }
+ break;
+
default:
printf("XInputWireToEvent: UNKNOWN WIRE EVENT! type=%d\n", type);
break;