diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-03-14 00:36:34 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-03-19 13:08:25 +0000 |
commit | 01e1df90a7debd333314720fdd5cf6cd9964d796 (patch) | |
tree | 1a5c9e7b6921630d99f52fa46072da20752a6350 /src/plugins/platforms/xcb | |
parent | dc753374478d751c7c124030429e90d058934f9f (diff) |
Move screen maintenance functions from QPlatformIntegration to QWSI
QWindowSystemInterface is the de facto API for any plumbing going from
the platform plugin to QtGui. Having the functions as protected members
of QPlatformIntegration was idiosyncratic, and resulted in awkward
workarounds to be able to call the functions from outside of the
QPlatformIntegration subclass.
The functions in QPlatformIntegration have been left in, but deprecated
so that platform plugins outside of qtbase have a chance to move over to
the new QWSI API before they are removed.
Change-Id: I327fec460db6b0faaf0ae2a151c20aa30dbe7182
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection.cpp | 3 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbconnection_screens.cpp | 12 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbintegration.h | 2 |
3 files changed, 8 insertions, 9 deletions
diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 29acf0e86d..0d71a5a552 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -146,10 +146,9 @@ QXcbConnection::~QXcbConnection() if (m_eventQueue) delete m_eventQueue; - 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()); + QWindowSystemInterface::handleScreenRemoved(m_screens.takeLast()); while (!m_virtualDesktops.isEmpty()) delete m_virtualDesktops.takeLast(); diff --git a/src/plugins/platforms/xcb/qxcbconnection_screens.cpp b/src/plugins/platforms/xcb/qxcbconnection_screens.cpp index 9aba996bb9..4e631beb25 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_screens.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_screens.cpp @@ -44,6 +44,8 @@ #include <QtCore/QString> #include <QtCore/QList> +#include <qpa/qwindowsysteminterface.h> + #include <xcb/xinerama.h> void QXcbConnection::xrandrSelectEvents() @@ -211,7 +213,7 @@ void QXcbConnection::updateScreen(QXcbScreen *screen, const xcb_randr_output_cha m_screens.swap(0, idx); } screen->virtualDesktop()->setPrimaryScreen(screen); - QXcbIntegration::instance()->setPrimaryScreen(screen); + QWindowSystemInterface::handlePrimaryScreenChanged(screen); } } } @@ -234,7 +236,7 @@ QXcbScreen *QXcbConnection::createScreen(QXcbVirtualDesktop *virtualDesktop, m_screens.append(screen); } virtualDesktop->addScreen(screen); - QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); + QWindowSystemInterface::handleScreenAdded(screen, screen->isPrimary()); return screen; } @@ -261,10 +263,10 @@ void QXcbConnection::destroyScreen(QXcbScreen *screen) const int idx = m_screens.indexOf(newPrimary); if (idx > 0) m_screens.swap(0, idx); - QXcbIntegration::instance()->setPrimaryScreen(newPrimary); + QWindowSystemInterface::handlePrimaryScreenChanged(newPrimary); } - QXcbIntegration::instance()->destroyScreen(screen); + QWindowSystemInterface::handleScreenRemoved(screen); } } @@ -406,7 +408,7 @@ void QXcbConnection::initializeScreens() // Push the screens to QGuiApplication for (QXcbScreen *screen : qAsConst(m_screens)) { qCDebug(lcQpaScreen) << "adding" << screen << "(Primary:" << screen->isPrimary() << ")"; - QXcbIntegration::instance()->screenAdded(screen, screen->isPrimary()); + QWindowSystemInterface::handleScreenAdded(screen, screen->isPrimary()); } qCDebug(lcQpaScreen) << "primary output is" << qAsConst(m_screens).first()->name(); diff --git a/src/plugins/platforms/xcb/qxcbintegration.h b/src/plugins/platforms/xcb/qxcbintegration.h index f13e232291..571726c354 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.h +++ b/src/plugins/platforms/xcb/qxcbintegration.h @@ -137,8 +137,6 @@ private: QScopedPointer<QPlatformServices> m_services; - friend class QXcbConnection; // access QPlatformIntegration::screenAdded() - mutable QByteArray m_wmClass; const char *m_instanceName; bool m_canGrab; |