diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-03-03 13:37:38 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-03-03 13:37:38 +0100 |
commit | c0a5e8c9d77aefd6c403af39908e56414a921522 (patch) | |
tree | c07b28deb9abc9789386f1b10585f1c661bfcba5 /src/plugins/platforms/xcb | |
parent | 4fd8513475222ee0afb6f18ec90ba384ffb03bc4 (diff) | |
parent | 2b5982aac8ad103443e33379fe5654f5bd419c87 (diff) |
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
src/plugins/platforms/xcb/qxcbscreen.cpp
Change-Id: Ie42931791a849b34b63d814d2eb5ac653986d868
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp | 2 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 94 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.h | 3 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 11 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbintegration.cpp | 12 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbintegration.h | 5 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 10 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbscreen.cpp | 66 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbscreen.h | 9 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindow.cpp | 2 |
10 files changed, 135 insertions, 79 deletions
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp index 891f187238..562b5c154f 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp @@ -100,7 +100,7 @@ QPlatformNativeInterface::NativeResourceForWindowFunction QXcbEglNativeInterface void *QXcbEglNativeInterfaceHandler::eglDisplay() { - QXcbIntegration *integration = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration()); + QXcbIntegration *integration = QXcbIntegration::instance(); QXcbEglIntegration *eglIntegration = static_cast<QXcbEglIntegration *>(integration->defaultConnection()->glIntegration()); return eglIntegration->eglDisplay(); } diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 3870c104a4..57dcdc8f9c 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -80,6 +80,7 @@ QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQpaXInput, "qt.qpa.input") Q_LOGGING_CATEGORY(lcQpaXInputDevices, "qt.qpa.input.devices") +Q_LOGGING_CATEGORY(lcQpaScreen, "qt.qpa.screen") #ifdef XCB_USE_XLIB static const char * const xcbConnectionErrors[] = { @@ -143,9 +144,8 @@ QXcbScreen* QXcbConnection::findOrCreateScreen(QList<QXcbScreen *>& newScreens, void QXcbConnection::updateScreens() { xcb_screen_iterator_t it = xcb_setup_roots_iterator(m_setup); - int screenNumber = 0; // index of this QScreen in QGuiApplication::screens() int xcbScreenNumber = 0; // screen number in the xcb sense - QSet<QXcbScreen *> activeScreens; + QList<QXcbScreen *> activeScreens; QList<QXcbScreen *> newScreens; QXcbScreen* primaryScreen = NULL; while (it.rem) { @@ -156,6 +156,7 @@ void QXcbConnection::updateScreens() xcb_screen_t *xcbScreen = it.data; QList<QPlatformScreen *> siblings; int outputCount = 0; + int connectedOutputCount = 0; if (has_randr_extension) { xcb_generic_error_t *error = NULL; xcb_randr_get_output_primary_cookie_t primaryCookie = @@ -185,22 +186,18 @@ void QXcbConnection::updateScreens() if (output == NULL) continue; -#ifdef Q_XCB_DEBUG - QString outputName = QString::fromUtf8((const char*)xcb_randr_get_output_info_name(output), - xcb_randr_get_output_info_name_length(output)); -#endif if (output->crtc == XCB_NONE) { -#ifdef Q_XCB_DEBUG - qDebug("Screen output %s is not connected", qPrintable(outputName)); -#endif + qCDebug(lcQpaScreen, "output %s is not connected", qPrintable( + QString::fromUtf8((const char*)xcb_randr_get_output_info_name(output), + xcb_randr_get_output_info_name_length(output)))); continue; } QXcbScreen *screen = findOrCreateScreen(newScreens, xcbScreenNumber, xcbScreen, output); siblings << screen; activeScreens << screen; - ++screenNumber; + ++connectedOutputCount; // There can be multiple outputs per screen, use either // the first or an exact match. An exact match isn't // always available if primary->output is XCB_NONE @@ -209,9 +206,6 @@ void QXcbConnection::updateScreens() if (!primaryScreen || (primary && outputs[i] == primary->output)) { primaryScreen = screen; siblings.prepend(siblings.takeLast()); -#ifdef Q_XCB_DEBUG - qDebug("Primary output is %d: %s", primary->output, qPrintable(outputName)); -#endif } } free(output); @@ -223,16 +217,13 @@ void QXcbConnection::updateScreens() } // If there's no randr extension, or there was some error above, or the screen // doesn't have outputs for some other reason (e.g. on VNC or ssh -X), just assume there is one screen. - if (outputCount == 0) { -#ifdef Q_XCB_DEBUG - qDebug("Found a screen with zero outputs"); -#endif + if (connectedOutputCount == 0) { + qCDebug(lcQpaScreen, "found a screen with zero outputs"); QXcbScreen *screen = findOrCreateScreen(newScreens, xcbScreenNumber, xcbScreen); siblings << screen; activeScreens << screen; if (!primaryScreen) primaryScreen = screen; - ++screenNumber; } foreach (QPlatformScreen* s, siblings) ((QXcbScreen*)s)->setVirtualSiblings(siblings); @@ -240,29 +231,57 @@ void QXcbConnection::updateScreens() ++xcbScreenNumber; } // for each xcb screen - QXcbIntegration *integration = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration()); - // Now activeScreens is the complete set of screens which are active at this time. - // Delete any existing screens which are not in activeScreens + QXcbIntegration *integration = QXcbIntegration::instance(); + + // Rebuild screen list, ensuring primary screen is always in front, + // both in the QXcbConnection::m_screens list as well as in the + // QGuiApplicationPrivate::screen_list list, which gets updated via + // - screen added: integration->screenAdded() + // - screen removed: integration->destroyScreen + + // Gather screens to delete + QList<QXcbScreen*> screensToDelete; for (int i = m_screens.count() - 1; i >= 0; --i) { if (!activeScreens.contains(m_screens[i])) { - integration->destroyScreen(m_screens.at(i)); - m_screens.removeAt(i); + screensToDelete.append(m_screens.takeAt(i)); } } - // Add any new screens, and make sure the primary screen comes first - // since it is used by QGuiApplication::primaryScreen() + // If there is a new primary screen, add that one first + if (newScreens.contains(primaryScreen)) { + newScreens.removeOne(primaryScreen); + m_screens.prepend(primaryScreen); + qCDebug(lcQpaScreen) << "adding as primary" << primaryScreen; + integration->screenAdded(primaryScreen, true); + } + + // Add the remaining new screens foreach (QXcbScreen* screen, newScreens) { - if (screen == primaryScreen) - m_screens.prepend(screen); - else - m_screens.append(screen); + m_screens.append(screen); + qCDebug(lcQpaScreen) << "adding" << screen; + integration->screenAdded(screen); } - // Now that they are in the right order, emit the added signals for new screens only - foreach (QXcbScreen* screen, m_screens) - if (newScreens.contains(screen)) - integration->screenAdded(screen); + // Delete the old screens, now that the new ones were added + // and we are sure that there is at least one screen available + foreach (QXcbScreen* screen, screensToDelete) { + qCDebug(lcQpaScreen) << "removing" << screen; + integration->destroyScreen(screen); + } + + // Ensure that the primary screen is first in m_screens too + // (in case the assignment of primary was the only change, + // without adding or removing screens) + if (primaryScreen) { + Q_ASSERT(!m_screens.isEmpty()); + if (m_screens.first() != primaryScreen) { + m_screens.removeOne(primaryScreen); + m_screens.prepend(primaryScreen); + } + } + + if (!m_screens.isEmpty()) + qCDebug(lcQpaScreen) << "primary output is" << m_screens.first()->name(); } QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGrabServer, const char *displayName) @@ -280,7 +299,6 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra , has_shape_extension(false) , has_randr_extension(false) , has_input_shape(false) - , has_touch_without_mouse_emulation(false) , has_xkb(false) , m_buttons(0) , m_focusWindow(0) @@ -404,7 +422,7 @@ QXcbConnection::~QXcbConnection() delete m_reader; - QXcbIntegration *integration = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration()); + QXcbIntegration *integration = QXcbIntegration::instance(); // Delete screens in reverse order to avoid crash in case of multiple screens while (!m_screens.isEmpty()) integration->destroyScreen(m_screens.takeLast()); @@ -794,8 +812,10 @@ void QXcbConnection::handleMotionNotify(xcb_generic_event_t *ev) xcb_motion_notify_event_t *event = (xcb_motion_notify_event_t *)ev; m_buttons = (m_buttons & ~0x7) | translateMouseButtons(event->state); - if (Q_UNLIKELY(lcQpaXInput().isDebugEnabled())) - qDebug("xcb: moved mouse to %4d, %4d; button state %X", event->event_x, event->event_y, static_cast<unsigned int>(m_buttons)); +#ifdef Q_XCB_DEBUG + qCDebug(lcQpaXInput, "xcb: moved mouse to %4d, %4d; button state %X", + event->event_x, event->event_y, static_cast<unsigned int>(m_buttons)); +#endif } #ifndef QT_NO_XKB diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index 585ff95c19..97c2590708 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -77,6 +77,7 @@ QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQpaXInput) Q_DECLARE_LOGGING_CATEGORY(lcQpaXInputDevices) +Q_DECLARE_LOGGING_CATEGORY(lcQpaScreen) class QXcbScreen; class QXcbWindow; @@ -441,7 +442,6 @@ public: bool hasXShape() const { return has_shape_extension; } bool hasXRandr() const { return has_randr_extension; } bool hasInputShape() const { return has_input_shape; } - bool hasTouchWithoutMouseEmulation() const { return has_touch_without_mouse_emulation; } bool hasXKB() const { return has_xkb; } bool supportsThreadedRendering() const { return m_reader->isRunning(); } @@ -611,7 +611,6 @@ private: bool has_shape_extension; bool has_randr_extension; bool has_input_shape; - bool has_touch_without_mouse_emulation; bool has_xkb; Qt::MouseButtons m_buttons; diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index e9fb47dabd..d1b3ead11c 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -282,14 +282,14 @@ void QXcbConnection::xi2Select(xcb_window_t window) mask.mask_len = sizeof(bitMask); mask.mask = xiBitMask; if (!m_touchDevices.isEmpty()) { - mask.deviceid = XIAllMasterDevices; - Status result = XISelectEvents(xDisplay, window, &mask, 1); // If we select for touch events on the master pointer, XInput2 // will not synthesize mouse events. This means Qt must do it, // which is also preferable, since Qt can control better when // to do so. - if (result == Success) - has_touch_without_mouse_emulation = true; + mask.deviceid = XIAllMasterDevices; + Status result = XISelectEvents(xDisplay, window, &mask, 1); + if (result != Success) + qCDebug(lcQpaXInput, "XInput 2.2: failed to select touch events, window %x, result %d", window, result); } } #endif // XCB_USE_XINPUT22 @@ -424,6 +424,9 @@ XInput2TouchDeviceData *QXcbConnection::touchDeviceForId(int id) dev->size.width() > 10000 || dev->size.height() > 10000) dev->size = QSizeF(130, 110); } + if (!isUsingXInput22() || type == QTouchDevice::TouchPad) + caps |= QTouchDevice::MouseEmulation; + if (type >= QTouchDevice::TouchScreen && type <= QTouchDevice::TouchPad) { dev->qtTouchDevice = new QTouchDevice; dev->qtTouchDevice->setName(QString::fromUtf8(dev->xiDeviceInfo->name)); diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 2e9ba0e8c5..258359d20f 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -110,11 +110,15 @@ static bool runningUnderDebugger() #endif } +QXcbIntegration *QXcbIntegration::m_instance = Q_NULLPTR; + QXcbIntegration::QXcbIntegration(const QStringList ¶meters, int &argc, char **argv) : m_services(new QGenericUnixServices) , m_instanceName(0) , m_canGrab(true) { + m_instance = this; + qRegisterMetaType<QXcbWindow*>(); #ifdef XCB_USE_XLIB XInitThreads(); @@ -166,9 +170,7 @@ QXcbIntegration::QXcbIntegration(const QStringList ¶meters, int &argc, char m_connections << new QXcbConnection(m_nativeInterface.data(), m_canGrab, displayName); for (int i = 0; i < parameters.size() - 1; i += 2) { -#ifdef Q_XCB_DEBUG - qDebug() << "QXcbIntegration: Connecting to additional display: " << parameters.at(i) << parameters.at(i+1); -#endif + qCDebug(lcQpaScreen) << "connecting to additional display: " << parameters.at(i) << parameters.at(i+1); QString display = parameters.at(i) + QLatin1Char(':') + parameters.at(i+1); m_connections << new QXcbConnection(m_nativeInterface.data(), m_canGrab, display.toLatin1().constData()); } @@ -179,6 +181,7 @@ QXcbIntegration::QXcbIntegration(const QStringList ¶meters, int &argc, char QXcbIntegration::~QXcbIntegration() { qDeleteAll(m_connections); + m_instance = Q_NULLPTR; } QPlatformWindow *QXcbIntegration::createPlatformWindow(QWindow *window) const @@ -371,9 +374,6 @@ QVariant QXcbIntegration::styleHint(QPlatformIntegration::StyleHint hint) const // X11 always has support for windows, but the // window manager could prevent it (e.g. matchbox) return false; - case QPlatformIntegration::SynthesizeMouseFromTouchEvents: - // We do not want Qt to synthesize mouse events if X11 already does it. - return m_connections.at(0)->hasTouchWithoutMouseEmulation(); default: break; } diff --git a/src/plugins/platforms/xcb/qxcbintegration.h b/src/plugins/platforms/xcb/qxcbintegration.h index 0af9df55aa..4212d53810 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.h +++ b/src/plugins/platforms/xcb/qxcbintegration.h @@ -101,6 +101,9 @@ public: #endif void sync() Q_DECL_OVERRIDE; + + static QXcbIntegration *instance() { return m_instance; } + private: QList<QXcbConnection *> m_connections; @@ -120,6 +123,8 @@ private: mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; + + static QXcbIntegration *m_instance; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 701ca91b37..6cb238228f 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -363,7 +363,7 @@ void *QXcbNativeInterface::getTimestamp(const QXcbScreen *screen) void *QXcbNativeInterface::startupId() { - QXcbIntegration* integration = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration()); + QXcbIntegration* integration = QXcbIntegration::instance(); QXcbConnection *defaultConnection = integration->defaultConnection(); if (defaultConnection) return reinterpret_cast<void *>(const_cast<char *>(defaultConnection->startupId().constData())); @@ -372,7 +372,7 @@ void *QXcbNativeInterface::startupId() void *QXcbNativeInterface::x11Screen() { - QXcbIntegration *integration = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration()); + QXcbIntegration *integration = QXcbIntegration::instance(); QXcbConnection *defaultConnection = integration->defaultConnection(); if (defaultConnection) return reinterpret_cast<void *>(defaultConnection->primaryScreenNumber()); @@ -381,7 +381,7 @@ void *QXcbNativeInterface::x11Screen() void *QXcbNativeInterface::rootWindow() { - QXcbIntegration *integration = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration()); + QXcbIntegration *integration = QXcbIntegration::instance(); QXcbConnection *defaultConnection = integration->defaultConnection(); if (defaultConnection) return reinterpret_cast<void *>(defaultConnection->rootWindow()); @@ -391,7 +391,7 @@ void *QXcbNativeInterface::rootWindow() void *QXcbNativeInterface::display() { #ifdef XCB_USE_XLIB - QXcbIntegration *integration = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration()); + QXcbIntegration *integration = QXcbIntegration::instance(); QXcbConnection *defaultConnection = integration->defaultConnection(); return defaultConnection->xlib_display(); #else @@ -412,7 +412,7 @@ void QXcbNativeInterface::setAppUserTime(QScreen* screen, xcb_timestamp_t time) void QXcbNativeInterface::setStartupId(const char *data) { QByteArray startupId(data); - QXcbIntegration *integration = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration()); + QXcbIntegration *integration = QXcbIntegration::instance(); QXcbConnection *defaultConnection = integration->defaultConnection(); if (defaultConnection) defaultConnection->setStartupId(startupId); diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index 57a777b682..58a364848a 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -93,25 +93,6 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, xcb_screen_t *scr, if (dpr_scaling_enabled) m_noFontHinting = true; -#ifdef Q_XCB_DEBUG - qDebug(); - qDebug("Screen output %s of xcb screen %d:", m_outputName.toUtf8().constData(), m_number); - qDebug(" width..........: %lf", m_sizeMillimeters.width()); - qDebug(" height.........: %lf", m_sizeMillimeters.height()); - qDebug(" geometry.......: %d x %d +%d +%d", m_geometry.width(), m_geometry.height(), m_geometry.x(), m_geometry.y()); - qDebug(" virtual width..: %lf", m_virtualSizeMillimeters.width()); - qDebug(" virtual height.: %lf", m_virtualSizeMillimeters.height()); - qDebug(" virtual geom...: %d x %d", m_virtualSize.width(), m_virtualSize.height()); - qDebug(" avail virt geom: %d x %d +%d +%d", m_availableGeometry.width(), m_availableGeometry.height(), m_availableGeometry.x(), m_availableGeometry.y()); - qDebug(" orientation....: %d", m_orientation); - qDebug(" pixel ratio....: %d", m_devicePixelRatio); - qDebug(" depth..........: %d", screen()->root_depth); - qDebug(" white pixel....: %x", screen()->white_pixel); - qDebug(" black pixel....: %x", screen()->black_pixel); - qDebug(" refresh rate...: %d", m_refreshRate); - qDebug(" root ID........: %x", screen()->root); -#endif - QScopedPointer<xcb_get_window_attributes_reply_t, QScopedPointerPodDeleter> rootAttribs( xcb_get_window_attributes_reply(xcb_connection(), xcb_get_window_attributes_unchecked(xcb_connection(), screen()->root), NULL)); @@ -146,10 +127,6 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, xcb_screen_t *scr, atom(QXcbAtom::UTF8_STRING), 0, 1024), NULL); if (windowManagerReply && windowManagerReply->format == 8 && windowManagerReply->type == atom(QXcbAtom::UTF8_STRING)) { m_windowManagerName = QString::fromUtf8((const char *)xcb_get_property_value(windowManagerReply), xcb_get_property_value_length(windowManagerReply)); -#ifdef Q_XCB_DEBUG - qDebug(" window manager.: %s", qPrintable(m_windowManagerName)); - qDebug(); -#endif } free(windowManagerReply); @@ -710,4 +687,47 @@ QXcbXSettings *QXcbScreen::xSettings() const return m_xSettings; } +static inline void formatRect(QDebug &debug, const QRect r) +{ + debug << r.width() << 'x' << r.height() + << forcesign << r.x() << r.y() << noforcesign; +} + +static inline void formatSizeF(QDebug &debug, const QSizeF s) +{ + debug << s.width() << 'x' << s.height() << "mm"; +} + +Q_XCB_EXPORT QDebug operator<<(QDebug debug, const QXcbScreen *screen) +{ + const QDebugStateSaver saver(debug); + debug.nospace(); + debug << "QXcbScreen(" << (void *)screen; + if (screen) { + debug << fixed << qSetRealNumberPrecision(1); + debug << ", name=" << screen->name(); + debug << ", geometry="; + formatRect(debug, screen->geometry()); + debug << ", availableGeometry="; + formatRect(debug, screen->availableGeometry()); + debug << ", devicePixelRatio=" << screen->devicePixelRatio(); + debug << ", logicalDpi=" << screen->logicalDpi(); + debug << ", physicalSize="; + formatSizeF(debug, screen->physicalSize()); + // TODO 5.6 if (debug.verbosity() > 2) { + debug << ", screenNumber=" << screen->screenNumber(); + debug << ", virtualSize=" << screen->virtualSize().width() << "x" << screen->virtualSize().height() << " ("; + formatSizeF(debug, screen->virtualSize()); + debug << "), nativeGeometry="; + formatRect(debug, screen->nativeGeometry()); + debug << ", orientation=" << screen->orientation(); + debug << ", depth=" << screen->depth(); + debug << ", refreshRate=" << screen->refreshRate(); + debug << ", root=" << hex << screen->root(); + debug << ", windowManagerName=" << screen->windowManagerName(); + } + debug << ')'; + return debug; +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h index f327eb31b0..53ad413541 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.h +++ b/src/plugins/platforms/xcb/qxcbscreen.h @@ -50,6 +50,9 @@ QT_BEGIN_NAMESPACE class QXcbConnection; class QXcbCursor; class QXcbXSettings; +#ifndef QT_NO_DEBUG_STREAM +class QDebug; +#endif class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { @@ -68,6 +71,8 @@ public: int depth() const Q_DECL_OVERRIDE { return m_screen->root_depth; } QImage::Format format() const Q_DECL_OVERRIDE; QSizeF physicalSize() const Q_DECL_OVERRIDE { return m_sizeMillimeters; } + QSize virtualSize() const { return m_virtualSize; } + QSizeF physicalVirtualSize() const { return m_virtualSizeMillimeters; } QDpi logicalDpi() const Q_DECL_OVERRIDE; qreal devicePixelRatio() const Q_DECL_OVERRIDE; QPlatformCursor *cursor() const Q_DECL_OVERRIDE; @@ -140,6 +145,10 @@ private: QXcbXSettings *m_xSettings; }; +#ifndef QT_NO_DEBUG_STREAM +Q_GUI_EXPORT QDebug operator<<(QDebug, const QXcbScreen *); +#endif + QT_END_NAMESPACE #endif diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 2253dfecef..222f6c1170 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -462,7 +462,7 @@ void QXcbWindow::create() m_syncValue.hi = 0; m_syncValue.lo = 0; - const QByteArray wmClass = static_cast<QXcbIntegration *>(QGuiApplicationPrivate::platformIntegration())->wmClass(); + const QByteArray wmClass = QXcbIntegration::instance()->wmClass(); if (!wmClass.isEmpty()) { Q_XCB_CALL(xcb_change_property(xcb_connection(), XCB_PROP_MODE_REPLACE, m_window, atom(QXcbAtom::WM_CLASS), |