Check if XListInputDevices returns an error.

Refs #351
This commit is contained in:
Felix Geyer committed 2015-09-26 12:41:52 +02:00
1 parent 727094abc6
commit fc8cb7cd14
1 file changed
+4 -2
+4 -2
View File
@@ -547,10 +547,12 @@ int AutoTypePlatformX11::x11ErrorHandler(Display* display, XErrorEvent* error)
XkbDescPtr AutoTypePlatformX11::getKeyboard()
{
XDeviceInfo* devices;
int num_devices;
XID keyboard_id = XkbUseCoreKbd;
devices = XListInputDevices(m_dpy, &num_devices);
XDeviceInfo* devices = XListInputDevices(m_dpy, &num_devices);
if (!devices) {
return Q_NULLPTR;
}
for (int i = 0; i < num_devices; i++) {
if (QString(devices[i].name) == "Virtual core XTEST keyboard") {