xcb: drop Xinerama support

[ChangeLog][Important Behavior Changes][X11] Xinerama is no longer
supported.

Fixes: QTBUG-86082
Change-Id: Ieb57d9035e1659fc22bf8333247fc3573fb62992
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
This commit is contained in:
Liang Qi 2020-08-25 11:19:13 +02:00 committed by Tor Arne Vestbø
parent d85bc34b79
commit c91d1fdc10
11 changed files with 5 additions and 74 deletions

View File

@ -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) qt_find_package(XCB COMPONENTS XFIXES PROVIDED_TARGETS XCB::XFIXES MODULE_NAME gui QMAKE_LIB xcb_xfixes)
endif() endif()
qt_add_qmake_lib_dependency(xcb_xfixes xcb) 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) if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS)
qt_find_package(X11_XCB PROVIDED_TARGETS X11::XCB MODULE_NAME gui QMAKE_LIB xcb_xlib) qt_find_package(X11_XCB PROVIDED_TARGETS X11::XCB MODULE_NAME gui QMAKE_LIB xcb_xlib)
endif() endif()
@ -491,7 +487,6 @@ qt_config_compile_test(xcb_syslibs
XCB::SHM XCB::SHM
XCB::SYNC XCB::SYNC
XCB::XFIXES XCB::XFIXES
XCB::XINERAMA
XCB::XKB XCB::XKB
XCB::XCB XCB::XCB
CODE CODE
@ -506,7 +501,6 @@ qt_config_compile_test(xcb_syslibs
#include <xcb/shm.h> #include <xcb/shm.h>
#include <xcb/sync.h> #include <xcb/sync.h>
#include <xcb/xfixes.h> #include <xcb/xfixes.h>
#include <xcb/xinerama.h>
#include <xcb/xcb_icccm.h> #include <xcb/xcb_icccm.h>
#include <xcb/xcb_renderutil.h> #include <xcb/xcb_renderutil.h>
#include <xcb/xkb.h> #include <xcb/xkb.h>

View File

@ -598,15 +598,6 @@
], ],
"use": "xcb" "use": "xcb"
}, },
"xcb_xinerama": {
"label": "XCB Xinerama",
"headers": "xcb/xinerama.h",
"sources": [
{ "type": "pkgConfig", "args": "xcb-xinerama" },
"-lxcb-xinerama"
],
"use": "xcb"
},
"xcb_xlib": { "xcb_xlib": {
"label": "XCB Xlib", "label": "XCB Xlib",
"test": { "test": {
@ -973,7 +964,6 @@
"xcb/shm.h", "xcb/shm.h",
"xcb/sync.h", "xcb/sync.h",
"xcb/xfixes.h", "xcb/xfixes.h",
"xcb/xinerama.h",
"xcb/xcb_icccm.h", "xcb/xcb_icccm.h",
"xcb/xcb_renderutil.h", "xcb/xcb_renderutil.h",
"xcb/xkb.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);" "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": { "x11prefix": {
"label": "X11 prefix", "label": "X11 prefix",

View File

@ -53,7 +53,6 @@ qt_add_module(XcbQpa
XCB::SYNC XCB::SYNC
XCB::XCB XCB::XCB
XCB::XFIXES XCB::XFIXES
XCB::XINERAMA
XCB::XKB XCB::XKB
XKB::XKB XKB::XKB
) )

View File

@ -43,7 +43,6 @@
#include <xcb/shm.h> #include <xcb/shm.h>
#include <xcb/sync.h> #include <xcb/sync.h>
#include <xcb/xfixes.h> #include <xcb/xfixes.h>
#include <xcb/xinerama.h>
#include <xcb/render.h> #include <xcb/render.h>
#include <xcb/xinput.h> #include <xcb/xinput.h>
#define explicit dont_use_cxx_explicit #define explicit dont_use_cxx_explicit
@ -145,8 +144,6 @@ QXcbBasicConnection::QXcbBasicConnection(const char *displayName)
initializeShm(); initializeShm();
if (!qEnvironmentVariableIsSet("QT_XCB_NO_XRANDR")) if (!qEnvironmentVariableIsSet("QT_XCB_NO_XRANDR"))
initializeXRandr(); initializeXRandr();
if (!m_hasXRandr)
initializeXinerama();
initializeXFixes(); initializeXFixes();
initializeXRender(); initializeXRender();
if (!qEnvironmentVariableIsSet("QT_XCB_NO_XI2")) if (!qEnvironmentVariableIsSet("QT_XCB_NO_XI2"))
@ -307,17 +304,6 @@ void QXcbBasicConnection::initializeXRender()
m_xrenderVersion.second = xrenderQuery->minor_version; 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() void QXcbBasicConnection::initializeXFixes()
{ {
const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_xcbConnection, &xcb_xfixes_id); const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_xcbConnection, &xcb_xfixes_id);

View File

@ -96,7 +96,6 @@ public:
bool hasShm() const { return m_hasShm; } bool hasShm() const { return m_hasShm; }
bool hasShmFd() const { return m_hasShmFd; } bool hasShmFd() const { return m_hasShmFd; }
bool hasXSync() const { return m_hasXSync; } bool hasXSync() const { return m_hasXSync; }
bool hasXinerama() const { return m_hasXinerama; }
bool hasBigRequest() const; bool hasBigRequest() const;
bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; }
@ -113,7 +112,6 @@ protected:
void initializeXFixes(); void initializeXFixes();
void initializeXRender(); void initializeXRender();
void initializeXRandr(); void initializeXRandr();
void initializeXinerama();
void initializeXShape(); void initializeXShape();
void initializeXKB(); void initializeXKB();
void initializeXSync(); void initializeXSync();
@ -130,7 +128,6 @@ private:
QXcbAtom m_xcbAtom; QXcbAtom m_xcbAtom;
bool m_hasXFixes = false; bool m_hasXFixes = false;
bool m_hasXinerama = false;
bool m_hasXhape = false; bool m_hasXhape = false;
bool m_hasInputShape; bool m_hasInputShape;
bool m_hasXRandr = false; bool m_hasXRandr = false;

View File

@ -46,8 +46,6 @@
#include <qpa/qwindowsysteminterface.h> #include <qpa/qwindowsysteminterface.h>
#include <xcb/xinerama.h>
void QXcbConnection::xrandrSelectEvents() void QXcbConnection::xrandrSelectEvents()
{ {
xcb_screen_iterator_t rootIter = xcb_setup_roots_iterator(setup()); 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 (siblings.isEmpty()) {
// If there are no XRandR outputs or XRandR extension is missing, // If there are no XRandR outputs or XRandR extension is missing,

View File

@ -494,8 +494,7 @@ quint8 QXcbVirtualDesktop::depthOfVisual(xcb_visualid_t visualid) const
} }
QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop,
xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output)
const xcb_xinerama_screen_info_t *xineramaScreenInfo, int xineramaScreenIdx)
: QXcbObject(connection) : QXcbObject(connection)
, m_virtualDesktop(virtualDesktop) , m_virtualDesktop(virtualDesktop)
, m_output(outputId) , 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); updateGeometry(QRect(crtc->x, crtc->y, crtc->width, crtc->height), crtc->rotation);
updateRefreshRate(crtc->mode); 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()) if (m_geometry.isEmpty())

View File

@ -47,7 +47,6 @@
#include <xcb/xcb.h> #include <xcb/xcb.h>
#include <xcb/randr.h> #include <xcb/randr.h>
#include <xcb/xfixes.h> #include <xcb/xfixes.h>
#include <xcb/xinerama.h>
#include "qxcbobject.h" #include "qxcbobject.h"
@ -142,8 +141,7 @@ class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen
{ {
public: public:
QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop,
xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo);
const xcb_xinerama_screen_info_t *xineramaScreenInfo = nullptr, int xineramaScreenIdx = -1);
~QXcbScreen(); ~QXcbScreen();
QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo); QString getOutputName(xcb_randr_get_output_info_reply_t *outputInfo);

View File

@ -85,7 +85,7 @@ qtConfig(vulkan) {
QMAKE_USE += \ QMAKE_USE += \
xcb xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil \ 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) { qtConfig(system-xcb-xinput) {
QMAKE_USE += xcb_xinput QMAKE_USE += xcb_xinput

View File

@ -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 "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 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, 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 or above the first one, for example). This test app will
using two graphics cards but using Xinerama to combine them. This test app will
create two windows, and will center one each screen, by setting the geometry. 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 Alternatively you can configure xorg.conf to create separate screens for each

View File

@ -537,13 +537,6 @@ _library_map = [
extra=["COMPONENTS", "XFIXES"], extra=["COMPONENTS", "XFIXES"],
resultVariable="XCB_XFIXES", resultVariable="XCB_XFIXES",
), ),
LibraryMapping(
"xcb_xinerama",
"XCB",
"XCB::XINERAMA",
extra=["COMPONENTS", "XINERAMA"],
resultVariable="XCB_XINERAMA",
),
LibraryMapping( LibraryMapping(
"xcb_xinput", "xcb_xinput",
"XCB", "XCB",