diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-07-17 20:01:21 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-07-20 17:47:29 +0200 |
commit | 3a475d48ee03d1953292a8fe4ef8ab7e3b1e6c37 (patch) | |
tree | 2d8e5b5491067b3166e87c80abc7cbda151f29cf /src/plugins/platforms/xcb | |
parent | 6e5694b63b0275fe180da7b892b03a865d218d99 (diff) |
Add QXcbScreen platform interface
Task-number: QTBUG-84220
Change-Id: I6c166409fbaf50627dea65a6256764e08ab36a59
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 4 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbscreen.cpp | 8 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbscreen.h | 4 |
3 files changed, 3 insertions, 13 deletions
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 52b4ffa7a9..d725d49082 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -54,7 +54,6 @@ #include <QtGui/qscreen.h> #include <QtPlatformHeaders/private/qxcbwindowfunctions_p.h> -#include <QtPlatformHeaders/private/qxcbscreenfunctions_p.h> #include <stdio.h> @@ -329,9 +328,6 @@ QFunctionPointer QXcbNativeInterface::platformFunction(const QByteArray &functio return QFunctionPointer(QXcbWindowFunctions::VisualId(QXcbWindow::visualIdStatic)); } - if (function == QXcbScreenFunctions::virtualDesktopNumberIdentifier()) - return QFunctionPointer(QXcbScreenFunctions::VirtualDesktopNumber(reinterpret_cast<void *>(QXcbScreen::virtualDesktopNumberStatic))); - return nullptr; } diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index 505f7343ce..9dc7c97eab 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -702,14 +702,6 @@ void QXcbScreen::setOutput(xcb_randr_output_t outputId, // TODO: Send an event to the QScreen instance that the screen changed its name } -int QXcbScreen::virtualDesktopNumberStatic(const QScreen *screen) -{ - if (screen && screen->handle()) - return static_cast<const QXcbScreen *>(screen->handle())->screenNumber(); - - return 0; -} - void QXcbScreen::updateGeometry(xcb_timestamp_t timestamp) { if (!connection()->hasXRandr()) diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h index 8a90d61b98..60ef82bae3 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.h +++ b/src/plugins/platforms/xcb/qxcbscreen.h @@ -41,6 +41,7 @@ #define QXCBSCREEN_H #include <qpa/qplatformscreen.h> +#include <qpa/qplatformscreen_p.h> #include <QtCore/QString> #include <xcb/xcb.h> @@ -137,6 +138,7 @@ private: }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen + , public QPlatformInterface::Private::QXcbScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, @@ -171,7 +173,7 @@ public: bool isPrimary() const { return m_primary; } int screenNumber() const { return m_virtualDesktop->number(); } - static int virtualDesktopNumberStatic(const QScreen *screen); + int virtualDesktopNumber() const override { return screenNumber(); } xcb_screen_t *screen() const { return m_virtualDesktop->screen(); } xcb_window_t root() const { return screen()->root; } |