diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index 411e4e54..21e7e0e4 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -536,6 +536,7 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDe , m_crtc(output ? output->crtc : XCB_NONE) , m_outputName(getOutputName(output)) , m_outputSizeMillimeters(output ? QSize(output->mm_width, output->mm_height) : QSize()) + , m_cursor(std::make_unique(connection, this)) { // if (connection->hasXRandr()) { if (connection->isAtLeastXRandR12()) { @@ -564,7 +565,7 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDe if (m_sizeMillimeters.isEmpty()) m_sizeMillimeters = virtualDesktop->physicalSize(); - m_cursor = new QXcbCursor(connection, this); + // m_cursor = new QXcbCursor(connection, this); // if (connection->hasXRandr()) { // Parse EDID if (connection->isAtLeastXRandR12()) { // Parse EDID @@ -592,6 +593,7 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDe : QXcbObject(connection) , m_virtualDesktop(virtualDesktop) , m_monitor(monitorInfo) + , m_cursor(std::make_unique(connection, this)) { setMonitor(monitorInfo, timestamp); } @@ -649,9 +651,9 @@ void QXcbScreen::setMonitor(xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp m_singlescreen = (monitorGeometry == (QRect(crtc->x, crtc->y, crtc->width, crtc->height))); if (m_singlescreen) { if (crtc->mode) { - if (crtc->rotation == XCB_RANDR_ROTATION_ROTATE_90 || - crtc->rotation == XCB_RANDR_ROTATION_ROTATE_270) - std::swap(crtc->width, crtc->height); + // if (crtc->rotation == XCB_RANDR_ROTATION_ROTATE_90 || + // crtc->rotation == XCB_RANDR_ROTATION_ROTATE_270) + // std::swap(crtc->width, crtc->height); updateGeometry(QRect(crtc->x, crtc->y, crtc->width, crtc->height), crtc->rotation); if (mode() != crtc->mode) updateRefreshRate(crtc->mode); @@ -675,10 +677,13 @@ void QXcbScreen::setMonitor(xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp QByteArray ba = connection()->atomName(monitorInfo->name); m_outputName = getName(monitorInfo); - if (monitorInfo->primary) + // if (monitorInfo->primary) + if (connection()->primaryScreenNumber() == virtualDesktop()->number() && monitorInfo->primary) m_primary = true; - m_cursor = new QXcbCursor(connection(), this); + // m_cursor = new QXcbCursor(connection(), this); + else + m_primary = false; } @@ -686,7 +691,7 @@ void QXcbScreen::setMonitor(xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp QXcbScreen::~QXcbScreen() { - delete m_cursor; + // delete m_cursor; } QString QXcbScreen::getName(xcb_randr_monitor_info_t *monitorInfo) @@ -861,7 +866,8 @@ QDpi QXcbScreen::logicalDpi() const QPlatformCursor *QXcbScreen::cursor() const { - return m_cursor; + // return m_cursor; + return m_cursor.get(); } void QXcbScreen::setOutput(xcb_randr_output_t outputId,