summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbcursor.cpp
diff options
context:
space:
mode:
authorGatis Paeglis <gatis.paeglis@qt.io>2018-10-26 14:07:36 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2018-11-07 18:51:00 +0000
commit2569ac2857a52fa271a7038e0c36fe3e5b2d760e (patch)
tree39f1f36ef7a88101f9fcc447be75cabbc055cae0 /src/plugins/platforms/xcb/qxcbcursor.cpp
parent7b9de1d4da67573d6bb0a6bf2fb0cdd1b7fb86a3 (diff)
xcb: fix regression with open/close hand cursors
On Linux the correspondence between cursor functions and names of cursors has never been standardized. Projects have either assembled their own cursor function-to-name lookup table or borrowed the table from other projects. The origins of our table is described in QTBUG-71423. On Ubuntu the default theme is called Adwaita. Before bd72950fbedc457fb997e99beff4767505ff5d8f, we would not find a cursor for 'openhand' and would fall-back to QXcbCursor:: createNonStandardCursor(). Which was sub-optimal, because the cursors created by the fall-back path don't look like the themed ones. But the situation was worse after bd72950fb (hence the regression) - the 'openhand' fall-back name 'fleur' is a symbolic link to 'grabbing', so we would get into a situation where Qt::OpenHandCursor displays the same as Qt::ClosedHandCursor. This patch adds a correct fall-back name for 'openhand' on Adwaita, which is 'grab'. 'grab' actually is a symbolic link to 'hand1', but 'hand1' with other theams is a pointing hand cursor, that is why we use the symbolic link's name in this case. The lookup table still appears to be incomplete when comparing e.g with KWin. Eventually we need to revise the table and put in a common place so it can be shared between X11 and Wayland, but is out-of-scope for this patch (see QTBUG-71423). Fixes: QTBUG-71296 Task-number: QTBUG-71423 Change-Id: I247ed4b346c2cd3fe1c7fd0440d3763e0033346b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbcursor.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp
index 57629ac03a..7831671d42 100644
--- a/src/plugins/platforms/xcb/qxcbcursor.cpp
+++ b/src/plugins/platforms/xcb/qxcbcursor.cpp
@@ -255,6 +255,7 @@ static const uint8_t * const cursor_bits20[] = {
forbidden_bits, forbiddenm_bits
};
+// ### FIXME This mapping is incomplete - QTBUG-71423
static const std::vector<const char *> cursorNames[] = {
{ "left_ptr", "default", "top_left_arrow", "left_arrow" },
{ "up_arrow" },
@@ -273,7 +274,7 @@ static const std::vector<const char *> cursorNames[] = {
{ "forbidden", "not-allowed", "crossed_circle", "circle", "03b6e0fcb3499374a867c041f52298f0" },
{ "whats_this", "help", "question_arrow", "5c6cd98b3f3ebcb1f9c7f1c204630408", "d9ce0ab605698f320427677b458ad60b" },
{ "left_ptr_watch", "half-busy", "progress", "00000000000000020006000e7e9ffc3f", "08e8e1c95fe2fc01f976f1e063a24ccd" },
- { "openhand", "fleur", "5aca4d189052212118709018842178c0", "9d800788f1b08800ae810202380a0822" },
+ { "openhand", "grab", "fleur", "5aca4d189052212118709018842178c0", "9d800788f1b08800ae810202380a0822" },
{ "closedhand", "grabbing", "208530c400c041818281048008011002" },
{ "dnd-copy", "copy" },
{ "dnd-move", "move" },