From 29f11d6290d8d862915dbc9d1cb73c5d698b2b24 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Fri, 20 Jan 2023 09:54:21 +0100 Subject: [PATCH] xcb: Fix QXcbCursor for secondary screen QXcbCursor is created for each screen in a multiscreen setup. Make sure xcb cursor context is created for all QXcbCursor instances otherwise xcb can't load cursor for non-primary screens. Amends commit 012132c60d625b2de0039bdda3c22a0a8fe2dfe5 Fixes: QTBUG-110434 Change-Id: I85da73a1069b681437b29c3e272d85f5d2dde130 Reviewed-by: Liang Qi (cherry picked from commit a61d537f0535308fe30494e7a8fa283dba13d72d) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/xcb/qxcbcursor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp index 6e847ceeec0..8f087edc9b5 100644 --- a/src/plugins/platforms/xcb/qxcbcursor.cpp +++ b/src/plugins/platforms/xcb/qxcbcursor.cpp @@ -258,14 +258,14 @@ QXcbCursor::QXcbCursor(QXcbConnection *conn, QXcbScreen *screen) m_bitmapCache.setMaxCost(8); #endif + updateContext(); + if (cursorCount++) return; cursorFont = xcb_generate_id(xcb_connection()); const char *cursorStr = "cursor"; xcb_open_font(xcb_connection(), cursorFont, strlen(cursorStr), cursorStr); - - updateContext(); } QXcbCursor::~QXcbCursor()