From c7b003ea3b8b4b7124d4971df7d910f2bc3fc4fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Mon, 30 Mar 2015 12:03:30 +0200 Subject: Use Xlib to resolve font cursor if possible before fallingback to uploading a bitmap cursor Task-number: QTBUG-30016 Change-Id: I53eeda6bb5f6cab66e3bc10a2e5382ce55cc1bab Reviewed-by: Laszlo Agocs --- src/plugins/platforms/xcb/qxcbcursor.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp index e3a04c1d7b..8dd27ec9c5 100644 --- a/src/plugins/platforms/xcb/qxcbcursor.cpp +++ b/src/plugins/platforms/xcb/qxcbcursor.cpp @@ -53,6 +53,12 @@ typedef int (*PtrXcursorLibrarySetTheme)(void *, const char *); typedef int (*PtrXcursorLibraryGetDefaultSize)(void *); #ifdef XCB_USE_XLIB +#include +enum { + XCursorShape = CursorShape +}; +#undef CursorShape + static PtrXcursorLibraryLoadCursor ptrXcursorLibraryLoadCursor = 0; static PtrXcursorLibraryGetTheme ptrXcursorLibraryGetTheme = 0; static PtrXcursorLibrarySetTheme ptrXcursorLibrarySetTheme = 0; @@ -552,6 +558,12 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) } if (cursor) return cursor; + if (!cursor && cursorId) { + cursor = XCreateFontCursor(DISPLAY_FROM_XCB(this), cursorId); + if (cursor) + return cursor; + } + #endif // Non-standard X11 cursors are created from bitmaps -- cgit v1.2.3