Changeset View
Changeset View
Standalone View
Standalone View
depends/patches/qt/no-xlib.patch
Show All 16 Lines | |||||
#include <QtGui/QBitmap> | #include <QtGui/QBitmap> | ||||
#include <QtGui/private/qguiapplication_p.h> | #include <QtGui/private/qguiapplication_p.h> | ||||
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) | +#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) | ||||
#include <X11/cursorfont.h> | #include <X11/cursorfont.h> | ||||
+#endif | +#endif | ||||
#include <xcb/xfixes.h> | #include <xcb/xfixes.h> | ||||
#include <xcb/xcb_image.h> | #include <xcb/xcb_image.h> | ||||
@@ -391,6 +393,7 @@ void QXcbCursor::changeCursor(QCursor *cursor, QWindow *window) | @@ -391,6 +391,7 @@ void QXcbCursor::changeCursor(QCursor *cursor, QWindow *window) | ||||
xcb_flush(xcb_connection()); | xcb_flush(xcb_connection()); | ||||
} | } | ||||
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) | +#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) | ||||
static int cursorIdForShape(int cshape) | static int cursorIdForShape(int cshape) | ||||
{ | { | ||||
int cursorId = 0; | int cursorId = 0; | ||||
@@ -444,6 +447,7 @@ static int cursorIdForShape(int cshape) | @@ -444,6 +445,7 @@ static int cursorIdForShape(int cshape) | ||||
} | } | ||||
return cursorId; | return cursorId; | ||||
} | } | ||||
+#endif | +#endif | ||||
xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape) | xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape) | ||||
{ | { | ||||
@@ -556,7 +560,9 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape) | @@ -556,7 +558,9 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape) | ||||
xcb_cursor_t QXcbCursor::createFontCursor(int cshape) | xcb_cursor_t QXcbCursor::createFontCursor(int cshape) | ||||
{ | { | ||||
xcb_connection_t *conn = xcb_connection(); | xcb_connection_t *conn = xcb_connection(); | ||||
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) | +#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) | ||||
int cursorId = cursorIdForShape(cshape); | int cursorId = cursorIdForShape(cshape); | ||||
+#endif | +#endif | ||||
xcb_cursor_t cursor = XCB_NONE; | xcb_cursor_t cursor = XCB_NONE; | ||||
// Try Xcursor first | // Try Xcursor first | ||||
@@ -585,7 +591,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) | @@ -586,6 +590,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) | ||||
// Non-standard X11 cursors are created from bitmaps | // Non-standard X11 cursors are created from bitmaps | ||||
cursor = createNonStandardCursor(cshape); | cursor = createNonStandardCursor(cshape); | ||||
- | |||||
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) | +#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) | ||||
// Create a glpyh cursor if everything else failed | // Create a glpyh cursor if everything else failed | ||||
if (!cursor && cursorId) { | if (!cursor && cursorId) { | ||||
cursor = xcb_generate_id(conn); | cursor = xcb_generate_id(conn); | ||||
@@ -593,6 +599,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) | @@ -593,6 +598,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) | ||||
cursorId, cursorId + 1, | cursorId, cursorId + 1, | ||||
0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0); | 0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0); | ||||
} | } | ||||
+#endif | +#endif | ||||
if (cursor && cshape >= 0 && cshape < Qt::LastCursor && connection()->hasXFixes()) { | if (cursor && cshape >= 0 && cshape < Qt::LastCursor && connection()->hasXFixes()) { | ||||
const char *name = cursorNames[cshape].front(); | const char *name = cursorNames[cshape].front(); | ||||
-- | -- | ||||
2.22.0 | 2.22.0 | ||||