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 <liang.qi@qt.io>
(cherry picked from commit a61d537f0535308fe30494e7a8fa283dba13d72d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Peter Varga 2023-01-20 09:54:21 +01:00 committed by Qt Cherry-pick Bot
parent 7280f5876b
commit 29f11d6290

View File

@ -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()