|
| 1 | +From 9563cef873ae82e06f60708d706d054717e801ce Mon Sep 17 00:00:00 2001 |
| 2 | +From: Carl Dong < [email protected]> |
| 3 | +Date: Thu, 18 Jul 2019 17:22:05 -0400 |
| 4 | +Subject: [PATCH] Wrap xlib related code blocks in #if's |
| 5 | + |
| 6 | +They are not necessary to compile QT. |
| 7 | +--- |
| 8 | + qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp | 8 ++++++++ |
| 9 | + 1 file changed, 8 insertions(+) |
| 10 | + |
| 11 | +diff --git a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp |
| 12 | +index 7c62c2e2b3..c05c6c0a07 100644 |
| 13 | +--- a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp |
| 14 | ++++ b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp |
| 15 | +@@ -49,7 +49,9 @@ |
| 16 | + #include <QtGui/QWindow> |
| 17 | + #include <QtGui/QBitmap> |
| 18 | + #include <QtGui/private/qguiapplication_p.h> |
| 19 | ++#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) |
| 20 | + #include <X11/cursorfont.h> |
| 21 | ++#endif |
| 22 | + #include <xcb/xfixes.h> |
| 23 | + #include <xcb/xcb_image.h> |
| 24 | + |
| 25 | +@@ -384,6 +386,7 @@ void QXcbCursor::changeCursor(QCursor *cursor, QWindow *widget) |
| 26 | + w->setCursor(c, isBitmapCursor); |
| 27 | + } |
| 28 | + |
| 29 | ++#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) |
| 30 | + static int cursorIdForShape(int cshape) |
| 31 | + { |
| 32 | + int cursorId = 0; |
| 33 | +@@ -437,6 +440,7 @@ static int cursorIdForShape(int cshape) |
| 34 | + } |
| 35 | + return cursorId; |
| 36 | + } |
| 37 | ++#endif |
| 38 | + |
| 39 | + xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape) |
| 40 | + { |
| 41 | +@@ -558,7 +562,9 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape) |
| 42 | + xcb_cursor_t QXcbCursor::createFontCursor(int cshape) |
| 43 | + { |
| 44 | + xcb_connection_t *conn = xcb_connection(); |
| 45 | ++#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) |
| 46 | + int cursorId = cursorIdForShape(cshape); |
| 47 | ++#endif |
| 48 | + xcb_cursor_t cursor = XCB_NONE; |
| 49 | + |
| 50 | + // Try Xcursor first |
| 51 | +@@ -589,6 +595,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) |
| 52 | + // Non-standard X11 cursors are created from bitmaps |
| 53 | + cursor = createNonStandardCursor(cshape); |
| 54 | + |
| 55 | ++#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) |
| 56 | + // Create a glpyh cursor if everything else failed |
| 57 | + if (!cursor && cursorId) { |
| 58 | + cursor = xcb_generate_id(conn); |
| 59 | +@@ -596,6 +603,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) |
| 60 | + cursorId, cursorId + 1, |
| 61 | + 0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0); |
| 62 | + } |
| 63 | ++#endif |
| 64 | + |
| 65 | + if (cursor && cshape >= 0 && cshape < Qt::LastCursor && connection()->hasXFixes()) { |
| 66 | + const char *name = cursorNames[cshape]; |
| 67 | +-- |
| 68 | +2.22.0 |
| 69 | + |
0 commit comments