Details
-
Task
-
Resolution: Done
-
P3: Somewhat important
-
None
-
None
-
012132c60d (qt/qtbase/dev) 012132c60d (qt/tqtc-qtbase/dev)
Description
XCB provides libxcb-cursor [1] as an replacement for Xlib's libXcurosr [2]. By looking at the source code it appears to be a full replacement with minor gap in API (particularly the API for explicitly setting a cursor theme), but functionality-wise it looks good. There are projects that already use libxcb-cursor:
apt-cache rdepends libxcb-cursor0 libxcb-cursor0 Reverse Depends: libxcb-cursor-dev awesome kwin-common kde-spectacle i3-wm
Kwin for example switched ~3 years ago:
commit 0faf2fbcf8645b8affb9501e353dcdd61ad10644 Author: Martin Gräßlin <mgraesslin@kde.org> Date: Wed Jan 28 14:49:27 2015 +0100 Use xcb_cursor library instead of Xlib based one in Cursor Straight forward port from XLib based XCursor library to the xcb variant which is considerably new. The xcb variant only allows to create xcb_cursor_t for the default theme and size. Which suits the needs in Cursor quite well, but means it's not a replacement for the usage in zoom effect.
Very few changes have gone into [1] in recent years, from which I conclude that the library is stable.
> The xcb variant only allows to create xcb_cursor_t for the default theme and size.
mgraesslin I guess by the default you meant whatever is in the RESOURCE_MANAGER property? Thus, not having XcursorSet/GetTheme type of API?
Current usages of libXcurosr APIs in QXcbCursor:
XcursorGetDefaultSize (libXcurosr):
We QLibrary::resolve() this function, but never use it, so it can be simply dropped. No replacement needed. It was added by [3].
XcursorGetTheme and XcursorSetTheme (libXcurosr):
Was added by [3] as a workaround to Gnome bug. The commit message did not elaborate on anything!!! but from looking around I see that it must have been gnome-settings-daemon [4] bug. See af8a40c2de0f1be5ca40ac851858f2fe8798a4ba [11] and 5852428ae909f8965c91bdddd02fbd21e9b6994e [12] in gnome-settings-daemon/plugins/xsettings/gsd-xsettings-manager.c
Gnome uses xsettings [5], but did not update the RESOURCE_MANAGER property. Something that many libraries depend on, including libXcursor. The fixed gnome-settings-daemon is in Ubuntu 16.04, which is the minimal supported Ubuntu version. On Unity gnome-settings-daemon is named unity-settings-daemon, but the source code is about the same. Don't know what version is on RHEL 6, so the safest would be to keep the read-from-xsettings-fallback from [3]. But then we need to add API for setting/getting theme name in [1]. We can bundle the [1] and always fallback to the bundled version at configure time when libxcb-cursor on the system is not recent enough (for example see libxkbcommon, where we automatically fallback to bundled when version requirement is not satisfied).
XcursorLibraryLoadCursor (libXcurosr):
Can simply be replaced with xcb_cursor_load_cursor(). And from the initial testing this library swap appears to fix the bug reported in QTBUG-30016 - "But the bug reappears as soon as I restart Qt Creator." We need to add code for listening for property changes on RESOURCE_MANAGER. I have not looked into details why libXcursor's XcursorLibraryLoadCursor would not work as expected.
XCreateFontCursor (Xlib):
Is a total nonsense and can be dropped. No replacement needed. For details see https://bugreports.qt.io/browse/QTBUG-30016?focusedCommentId=397117&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-397117 It was added by [6], and again with no proper explanation!!!
[1] https://cgit.freedesktop.org/xcb/util-cursor/
[2] https://cgit.freedesktop.org/xorg/lib/libXcursor/
[3] https://codereview.qt-project.org/#/c/54819/
[4] https://github.com/GNOME/gnome-settings-daemon
[5] http://standards.freedesktop.org/xsettings-spec/xsettings-0.5.html
[6] https://codereview.qt-project.org/#/c/109570/
[11] https://github.com/GNOME/gnome-settings-daemon/commit/af8a40c2de0f1be5ca40ac851858f2fe8798a4ba
[12] https://github.com/GNOME/gnome-settings-daemon/commit/5852428ae909f8965c91bdddd02fbd21e9b6994e
Attachments
Issue Links
- is duplicated by
-
QTBUG-88200 Switch from libXcursor to libxcb-cursor
- Closed
- relates to
-
QTBUG-27537 [regression] Some cursor types fall back to native x11 bitmap version
- Closed
-
QTBUG-30016 All cursors except the default 'arrow' cursor are using the wrong theme
- Closed
-
QTBUG-69411 XCB Plugin Changes in Qt 6
- Closed
-
PYSIDE-2306 Pyside6 xcb plugin error
- Closed
-
QTBUG-71296 Qt::OpenHandCursor displays the same as Qt::ClosedHandCursor (5.9 regression)
- Closed
-
QTBUG-115335 Linux Deploy missing runtime dependencies
- Closed
-
PYSIDE-2301 Unable to execute pyinstaller executables with pyside
- Closed
- resulted in
-
QTBUG-110434 [REG 6.4->6.5] Standard cursor shapes are not updated on a secondary screen
- Closed
-
QTBUG-128315 Include libxcb-cursor in standard install
- Closed
-
QTBUG-120014 Dependency for libxcb-cursor0 since Qt 6.5 is not mentioned in the documentation.
- Closed
For Gerrit Dashboard: QTBUG-67373 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
586146,5 | WIP: xcb: Implement dynamic symbols resolve for libxcb-cursor | dev | qt/qtbase | Status: NEW | -2 | 0 |
325414,16 | xcb: use libxcb-cursor to replace Xlib/libXcursor | dev | qt/qtbase | Status: MERGED | +2 | 0 |
433016,3 | Doc: add xcb-cursor dependency on Linux | dev | qt/qtdoc | Status: MERGED | +2 | 0 |
434852,2 | qtbase: add dependency to xcb-util-cursor | dev | yocto/meta-qt6 | Status: MERGED | +2 | 0 |