diff options
author | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2015-03-30 12:03:30 +0200 |
---|---|---|
committer | Jørgen Lind <jorgen.lind@theqtcompany.com> | 2015-03-30 12:55:56 +0000 |
commit | c7b003ea3b8b4b7124d4971df7d910f2bc3fc4fa (patch) | |
tree | 0cf188541262ad0c2a311ec601da046e8f234a3e | |
parent | 21d7ec80f026c75594c77a60ef30f9a42774768d (diff) |
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 <laszlo.agocs@theqtcompany.com>
-rw-r--r-- | src/plugins/platforms/xcb/qxcbcursor.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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 <X11/Xlib.h> +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 |