Check if XListInputDevices returns an error.

Refs #351
This commit is contained in:
Felix Geyer 2015-09-26 12:26:24 +02:00
parent 727094abc6
commit fc8cb7cd14

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") {