feather/contrib/depends/patches/qt/no-xlib.patch

69 lines
2.2 KiB
Diff
Raw Normal View History

2022-12-21 15:15:22 +00:00
From 0171c86423f6c5aa8becf1259d42a3e67b8da59c Mon Sep 17 00:00:00 2001
From: tobtoht <tob@featherwallet.org>
Date: Sun, 30 Oct 2022 17:43:43 +0100
Subject: [PATCH] no xlib
2022-06-02 12:50:33 +00:00
---
2022-12-21 15:15:22 +00:00
src/plugins/platforms/xcb/qxcbcursor.cpp | 8 ++++++++
2022-06-02 12:50:33 +00:00
1 file changed, 8 insertions(+)
diff --git a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
2022-12-21 15:15:22 +00:00
index 2cc39f1e85..90efc1f1fb 100644
2022-06-02 12:50:33 +00:00
--- a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp
2022-12-21 15:15:22 +00:00
@@ -13,7 +13,9 @@
2022-06-02 12:50:33 +00:00
#include <QtGui/QWindow>
#include <QtGui/QBitmap>
#include <QtGui/private/qguiapplication_p.h>
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
#include <X11/cursorfont.h>
+#endif
#include <xcb/xfixes.h>
#include <xcb/xcb_image.h>
2022-12-21 15:15:22 +00:00
@@ -357,6 +359,7 @@ void QXcbCursor::changeCursor(QCursor *cursor, QWindow *window)
2022-06-02 12:50:33 +00:00
xcb_flush(xcb_connection());
}
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
static int cursorIdForShape(int cshape)
{
int cursorId = 0;
2022-12-21 15:15:22 +00:00
@@ -410,6 +413,7 @@ static int cursorIdForShape(int cshape)
2022-06-02 12:50:33 +00:00
}
return cursorId;
}
+#endif
xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape)
{
2022-12-21 15:15:22 +00:00
@@ -524,7 +528,9 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape)
2022-06-02 12:50:33 +00:00
xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
{
xcb_connection_t *conn = xcb_connection();
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
int cursorId = cursorIdForShape(cshape);
+#endif
xcb_cursor_t cursor = XCB_NONE;
2022-12-21 15:15:22 +00:00
#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
@@ -556,6 +562,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
2022-06-02 12:50:33 +00:00
// Non-standard X11 cursors are created from bitmaps
cursor = createNonStandardCursor(cshape);
+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library)
2022-12-21 15:15:22 +00:00
// Create a glyph cursor if everything else failed
2022-06-02 12:50:33 +00:00
if (!cursor && cursorId) {
cursor = xcb_generate_id(conn);
2022-12-21 15:15:22 +00:00
@@ -563,6 +570,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape)
2022-06-02 12:50:33 +00:00
cursorId, cursorId + 1,
0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0);
}
+#endif
if (cursor && cshape >= 0 && cshape < Qt::LastCursor && connection()->hasXFixes()) {
const char *name = cursorNames[cshape].front();
--
2022-12-21 15:15:22 +00:00
2.38.1
2022-06-02 12:50:33 +00:00