no-xlib.patch raw
1 From 9563cef873ae82e06f60708d706d054717e801ce Mon Sep 17 00:00:00 2001
2 From: Carl Dong <contact@carldong.me>
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 --- a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
9 +++ b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
10 @@ -49,7 +49,9 @@
11 #include <QtGui/QWindow>
12 #include <QtGui/QBitmap>
13 #include <QtGui/private/qguiapplication_p.h>
14 +#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
15 #include <X11/cursorfont.h>
16 +#endif
17 #include <xcb/xfixes.h>
18 #include <xcb/xcb_image.h>
19
20 @@ -391,6 +393,7 @@ void QXcbCursor::changeCursor(QCursor *cursor, QWindow *window)
21 xcb_flush(xcb_connection());
22 }
23
24 +#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
25 static int cursorIdForShape(int cshape)
26 {
27 int cursorId = 0;
28 @@ -444,6 +447,7 @@ static int cursorIdForShape(int cshape)
29 }
30 return cursorId;
31 }
32 +#endif
33
34 xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape)
35 {
36 @@ -558,7 +562,9 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape)
37 xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
38 {
39 xcb_connection_t *conn = xcb_connection();
40 +#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
41 int cursorId = cursorIdForShape(cshape);
42 +#endif
43 xcb_cursor_t cursor = XCB_NONE;
44
45 #if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
46 @@ -590,6 +596,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
47 // Non-standard X11 cursors are created from bitmaps
48 cursor = createNonStandardCursor(cshape);
49
50 +#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
51 // Create a glpyh cursor if everything else failed
52 if (!cursor && cursorId) {
53 cursor = xcb_generate_id(conn);
54 @@ -597,6 +604,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
55 cursorId, cursorId + 1,
56 0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0);
57 }
58 +#endif
59
60 if (cursor && cshape >= 0 && cshape < Qt::LastCursor && connection()->hasXFixes()) {
61 const char *name = cursorNames[cshape].front();
62