From c91d1fdc100cda88b94217153def52ab7fe63d21 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 25 Aug 2020 11:19:13 +0200 Subject: [PATCH] xcb: drop Xinerama support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ChangeLog][Important Behavior Changes][X11] Xinerama is no longer supported. Fixes: QTBUG-86082 Change-Id: Ieb57d9035e1659fc22bf8333247fc3573fb62992 Reviewed-by: Tor Arne Vestbø Reviewed-by: Gatis Paeglis --- src/gui/configure.cmake | 6 ------ src/gui/configure.json | 12 +----------- src/plugins/platforms/xcb/CMakeLists.txt | 1 - .../platforms/xcb/qxcbconnection_basic.cpp | 14 -------------- .../platforms/xcb/qxcbconnection_basic.h | 3 --- .../platforms/xcb/qxcbconnection_screens.cpp | 17 ----------------- src/plugins/platforms/xcb/qxcbscreen.cpp | 10 +--------- src/plugins/platforms/xcb/qxcbscreen.h | 4 +--- src/plugins/platforms/xcb/xcb_qpa_lib.pro | 2 +- tests/manual/qscreen/README | 3 +-- util/cmake/helper.py | 7 ------- 11 files changed, 5 insertions(+), 74 deletions(-) diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake index a6d265183fe..c260bb86ad4 100644 --- a/src/gui/configure.cmake +++ b/src/gui/configure.cmake @@ -98,10 +98,6 @@ if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) qt_find_package(XCB COMPONENTS XFIXES PROVIDED_TARGETS XCB::XFIXES MODULE_NAME gui QMAKE_LIB xcb_xfixes) endif() qt_add_qmake_lib_dependency(xcb_xfixes xcb) -if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) - qt_find_package(XCB COMPONENTS XINERAMA PROVIDED_TARGETS XCB::XINERAMA MODULE_NAME gui QMAKE_LIB xcb_xinerama) -endif() -qt_add_qmake_lib_dependency(xcb_xinerama xcb) if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) qt_find_package(X11_XCB PROVIDED_TARGETS X11::XCB MODULE_NAME gui QMAKE_LIB xcb_xlib) endif() @@ -491,7 +487,6 @@ qt_config_compile_test(xcb_syslibs XCB::SHM XCB::SYNC XCB::XFIXES - XCB::XINERAMA XCB::XKB XCB::XCB CODE @@ -506,7 +501,6 @@ qt_config_compile_test(xcb_syslibs #include #include #include -#include #include #include #include diff --git a/src/gui/configure.json b/src/gui/configure.json index a29f870f055..80df53edd1d 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -598,15 +598,6 @@ ], "use": "xcb" }, - "xcb_xinerama": { - "label": "XCB Xinerama", - "headers": "xcb/xinerama.h", - "sources": [ - { "type": "pkgConfig", "args": "xcb-xinerama" }, - "-lxcb-xinerama" - ], - "use": "xcb" - }, "xcb_xlib": { "label": "XCB Xlib", "test": { @@ -973,7 +964,6 @@ "xcb/shm.h", "xcb/sync.h", "xcb/xfixes.h", - "xcb/xinerama.h", "xcb/xcb_icccm.h", "xcb/xcb_renderutil.h", "xcb/xkb.h" @@ -996,7 +986,7 @@ "xcb_xkb_get_kbd_by_name_replies_key_names_value_list_sizeof(nullptr, 0, 0, 0, 0, 0, 0, 0, 0);" ] }, - "use": "xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama xcb_xkb xcb" + "use": "xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xkb xcb" }, "x11prefix": { "label": "X11 prefix", diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index 22a955fec68..9b04785dcb8 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -53,7 +53,6 @@ qt_add_module(XcbQpa XCB::SYNC XCB::XCB XCB::XFIXES - XCB::XINERAMA XCB::XKB XKB::XKB ) diff --git a/src/plugins/platforms/xcb/qxcbconnection_basic.cpp b/src/plugins/platforms/xcb/qxcbconnection_basic.cpp index 18dee89adbc..020412fc87a 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_basic.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_basic.cpp @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #define explicit dont_use_cxx_explicit @@ -145,8 +144,6 @@ QXcbBasicConnection::QXcbBasicConnection(const char *displayName) initializeShm(); if (!qEnvironmentVariableIsSet("QT_XCB_NO_XRANDR")) initializeXRandr(); - if (!m_hasXRandr) - initializeXinerama(); initializeXFixes(); initializeXRender(); if (!qEnvironmentVariableIsSet("QT_XCB_NO_XI2")) @@ -307,17 +304,6 @@ void QXcbBasicConnection::initializeXRender() m_xrenderVersion.second = xrenderQuery->minor_version; } -void QXcbBasicConnection::initializeXinerama() -{ - const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_xcbConnection, &xcb_xinerama_id); - if (!reply || !reply->present) - return; - - auto xineramaActive = Q_XCB_REPLY(xcb_xinerama_is_active, m_xcbConnection); - if (xineramaActive && xineramaActive->state) - m_hasXinerama = true; -} - void QXcbBasicConnection::initializeXFixes() { const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_xcbConnection, &xcb_xfixes_id); diff --git a/src/plugins/platforms/xcb/qxcbconnection_basic.h b/src/plugins/platforms/xcb/qxcbconnection_basic.h index 109186f966b..bda02ce9c21 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_basic.h +++ b/src/plugins/platforms/xcb/qxcbconnection_basic.h @@ -96,7 +96,6 @@ public: bool hasShm() const { return m_hasShm; } bool hasShmFd() const { return m_hasShmFd; } bool hasXSync() const { return m_hasXSync; } - bool hasXinerama() const { return m_hasXinerama; } bool hasBigRequest() const; bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } @@ -113,7 +112,6 @@ protected: void initializeXFixes(); void initializeXRender(); void initializeXRandr(); - void initializeXinerama(); void initializeXShape(); void initializeXKB(); void initializeXSync(); @@ -130,7 +128,6 @@ private: QXcbAtom m_xcbAtom; bool m_hasXFixes = false; - bool m_hasXinerama = false; bool m_hasXhape = false; bool m_hasInputShape; bool m_hasXRandr = false; diff --git a/src/plugins/platforms/xcb/qxcbconnection_screens.cpp b/src/plugins/platforms/xcb/qxcbconnection_screens.cpp index 9ba71ada373..82b0f65774d 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_screens.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_screens.cpp @@ -46,8 +46,6 @@ #include -#include - void QXcbConnection::xrandrSelectEvents() { xcb_screen_iterator_t rootIter = xcb_setup_roots_iterator(setup()); @@ -358,21 +356,6 @@ void QXcbConnection::initializeScreens() } } } - } else if (hasXinerama()) { - // Xinerama is available - auto screens = Q_XCB_REPLY(xcb_xinerama_query_screens, xcb_connection()); - if (screens) { - xcb_xinerama_screen_info_iterator_t it = xcb_xinerama_query_screens_screen_info_iterator(screens.get()); - while (it.rem) { - xcb_xinerama_screen_info_t *screen_info = it.data; - QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, - XCB_NONE, nullptr, - screen_info, it.index); - siblings << screen; - m_screens << screen; - xcb_xinerama_screen_info_next(&it); - } - } } if (siblings.isEmpty()) { // If there are no XRandR outputs or XRandR extension is missing, diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index 6ce8a91f36a..c17be437cef 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -494,8 +494,7 @@ quint8 QXcbVirtualDesktop::depthOfVisual(xcb_visualid_t visualid) const } QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, - xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output, - const xcb_xinerama_screen_info_t *xineramaScreenInfo, int xineramaScreenIdx) + xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output) : QXcbObject(connection) , m_virtualDesktop(virtualDesktop) , m_output(outputId) @@ -511,13 +510,6 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDe updateGeometry(QRect(crtc->x, crtc->y, crtc->width, crtc->height), crtc->rotation); updateRefreshRate(crtc->mode); } - } else if (xineramaScreenInfo) { - m_geometry = QRect(xineramaScreenInfo->x_org, xineramaScreenInfo->y_org, - xineramaScreenInfo->width, xineramaScreenInfo->height); - m_availableGeometry = m_geometry & m_virtualDesktop->workArea(); - m_sizeMillimeters = sizeInMillimeters(m_geometry.size(), m_virtualDesktop->dpi()); - if (xineramaScreenIdx > -1) - m_outputName += QLatin1Char('-') + QString::number(xineramaScreenIdx); } if (m_geometry.isEmpty()) diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h index 60ef82bae3f..9298a67b2bc 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.h +++ b/src/plugins/platforms/xcb/qxcbscreen.h @@ -47,7 +47,6 @@ #include #include #include -#include #include "qxcbobject.h" @@ -142,8 +141,7 @@ class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen { public: QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, - xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, - const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1); + xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo); ~QXcbScreen(); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); diff --git a/src/plugins/platforms/xcb/xcb_qpa_lib.pro b/src/plugins/platforms/xcb/xcb_qpa_lib.pro index f44388cc6d5..bb57e16ab55 100644 --- a/src/plugins/platforms/xcb/xcb_qpa_lib.pro +++ b/src/plugins/platforms/xcb/xcb_qpa_lib.pro @@ -85,7 +85,7 @@ qtConfig(vulkan) { QMAKE_USE += \ xcb xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil \ - xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama xcb_xkb xkbcommon xkbcommon_x11 + xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xkb xkbcommon xkbcommon_x11 qtConfig(system-xcb-xinput) { QMAKE_USE += xcb_xinput diff --git a/tests/manual/qscreen/README b/tests/manual/qscreen/README index cd1324276d1..9170c83ffba 100644 --- a/tests/manual/qscreen/README +++ b/tests/manual/qscreen/README @@ -14,8 +14,7 @@ the two monitors connected to the outputs are combined into a single virtual "screen", but each screen has multiple outputs. In that case there will be a unique QScreen for each output, and they will be virtual siblings. The virtual geometry depends on how you arrange the monitors (second one is to the right, -or above the first one, for example). It should be about the same if you are -using two graphics cards but using Xinerama to combine them. This test app will +or above the first one, for example). This test app will create two windows, and will center one each screen, by setting the geometry. Alternatively you can configure xorg.conf to create separate screens for each diff --git a/util/cmake/helper.py b/util/cmake/helper.py index c9ce778e79f..5e0c4bf38ee 100644 --- a/util/cmake/helper.py +++ b/util/cmake/helper.py @@ -537,13 +537,6 @@ _library_map = [ extra=["COMPONENTS", "XFIXES"], resultVariable="XCB_XFIXES", ), - LibraryMapping( - "xcb_xinerama", - "XCB", - "XCB::XINERAMA", - extra=["COMPONENTS", "XINERAMA"], - resultVariable="XCB_XINERAMA", - ), LibraryMapping( "xcb_xinput", "XCB",