// Use dbus if/when we can, but fall back to using windowManagerName() for now
#ifndef QT_NO_XFIXES
- if (XFixesSelectSelectionInput)
- XFixesSelectSelectionInput(X11->display, QX11Info::appRootWindow(), ATOM(_NET_WM_CM_S0),
- XFixesSetSelectionOwnerNotifyMask
- | XFixesSelectionWindowDestroyNotifyMask
- | XFixesSelectionClientCloseNotifyMask);
+ XFixesSelectSelectionInput(X11->display, QX11Info::appRootWindow(), ATOM(_NET_WM_CM_S0),
+ XFixesSetSelectionOwnerNotifyMask
+ | XFixesSelectionWindowDestroyNotifyMask
+ | XFixesSelectionClientCloseNotifyMask);
#endif // QT_NO_XFIXES
X11->compositingManagerRunning = XGetSelectionOwner(X11->display,
ATOM(_NET_WM_CM_S0));
int ndev,
i,
j;
- bool gotStylus,
- gotEraser;
+ bool gotStylus, gotEraser;
XDeviceInfo *devices = 0, *devs;
XInputClassInfo *ip;
XAnyClassPtr any;
XAxisInfoPtr a;
XDevice *dev = 0;
- if (XListInputDevices) {
- devices = XListInputDevices(X11->display, &ndev);
- if (!devices)
- qWarning("QApplication: Failed to get list of tablet devices");
- }
- if (!devices)
+ devices = XListInputDevices(X11->display, &ndev);
+ if (!devices) {
+ qWarning("QApplication: Failed to get list of tablet devices");
ndev = -1;
+ }
+
QTabletEvent::TabletDevice deviceType;
for (devs = devices, i = 0; i < ndev && devs; i++, devs++) {
dev = 0;
continue;
if (gotStylus || gotEraser) {
- if (XOpenDevice)
- dev = XOpenDevice(X11->display, devs->id);
+ dev = XOpenDevice(X11->display, devs->id);
if (!dev)
continue;
tablet_devices()->append(device_data);
} // if (gotStylus || gotEraser)
}
- if (XFreeDeviceList)
- XFreeDeviceList(devices);
+ XFreeDeviceList(devices);
}
#endif // QT_NO_TABLET
#if !defined (QT_NO_TABLET)
QTabletDeviceDataList *devices = qt_tablet_devices();
- if (XCloseDevice)
- for (int i = 0; i < devices->size(); ++i)
- XCloseDevice(X11->display, (XDevice*)devices->at(i).device);
+ for (int i = 0; i < devices->size(); ++i)
+ XCloseDevice(X11->display, (XDevice*)devices->at(i).device);
devices->clear();
#endif
}
};
#ifndef QT_NO_XCURSOR
- if (XcursorLibraryLoadCursor) {
- // special case for non-standard dnd-* cursors
- switch (cshape) {
- case Qt::DragCopyCursor:
- hcurs = XcursorLibraryLoadCursor(dpy, "dnd-copy");
- break;
- case Qt::DragMoveCursor:
- hcurs = XcursorLibraryLoadCursor(dpy, "dnd-move");
- break;
- case Qt::DragLinkCursor:
- hcurs = XcursorLibraryLoadCursor(dpy, "dnd-link");
- break;
- default:
- break;
- }
- if (!hcurs)
- hcurs = XcursorLibraryLoadCursor(dpy, cursorNames[cshape]);
+ // special case for non-standard dnd-* cursors
+ switch (cshape) {
+ case Qt::DragCopyCursor:
+ hcurs = XcursorLibraryLoadCursor(dpy, "dnd-copy");
+ break;
+ case Qt::DragMoveCursor:
+ hcurs = XcursorLibraryLoadCursor(dpy, "dnd-move");
+ break;
+ case Qt::DragLinkCursor:
+ hcurs = XcursorLibraryLoadCursor(dpy, "dnd-link");
+ break;
+ default:
+ break;
}
+ if (!hcurs)
+ hcurs = XcursorLibraryLoadCursor(dpy, cursorNames[cshape]);
if (hcurs)
return;
#endif // QT_NO_XCURSOR
if (hcurs)
{
#ifndef QT_NO_XFIXES
- if (X11->use_xfixes && XFixesSetCursorName)
+ if (X11->use_xfixes)
XFixesSetCursorName(dpy, hcurs, cursorNames[cshape]);
#endif /* ! QT_NO_XFIXES */
return;
hcurs = XCreateFontCursor(dpy, sh);
#ifndef QT_NO_XFIXES
- if (X11->use_xfixes && XFixesSetCursorName)
+ if (X11->use_xfixes)
XFixesSetCursorName(dpy, hcurs, cursorNames[cshape]);
#endif /* ! QT_NO_XFIXES */
}
// we ignore the Xinerama extension when using the display is
// using traditional multi-screen (with multiple root windows)
- if (newScreenCount == 1
- && XineramaQueryExtension
- && XineramaIsActive
- && XineramaQueryScreens) {
+ if (newScreenCount == 1) {
int unused;
use_xinerama = (XineramaQueryExtension(X11->display, &unused, &unused)
&& XineramaIsActive(X11->display));
}
if (use_xinerama) {
- xinerama_screeninfo =
- XineramaQueryScreens(X11->display, &newScreenCount);
+ xinerama_screeninfo = XineramaQueryScreens(X11->display, &newScreenCount);
}
if (xinerama_screeninfo) {
XSelectInput(dpy, id, stdWidgetEventMask);
#if !defined (QT_NO_TABLET)
QTabletDeviceDataList *tablet_list = qt_tablet_devices();
- if (XSelectExtensionEvent) {
- for (int i = 0; i < tablet_list->size(); ++i) {
- QTabletDeviceData tablet = tablet_list->at(i);
- XSelectExtensionEvent(dpy, id, reinterpret_cast<XEventClass*>(tablet.eventList),
- tablet.eventCount);
- }
+ for (int i = 0; i < tablet_list->size(); ++i) {
+ QTabletDeviceData tablet = tablet_list->at(i);
+ XSelectExtensionEvent(dpy, id, reinterpret_cast<XEventClass*>(tablet.eventList),
+ tablet.eventCount);
}
#endif
}