configure: make xcb-render a hard dependency for xcb plugin
Its been available by default since at least libxcb 1.5, and in Qt 5.12 we have even increased the minimal required libxcb version to 1.9. Having configure switches for extensions is a legacy from Qt 4. There are still few exceptions in Qt5, where the reason is that we have to support Linux distributions that don't ship recent enough libxcb. Task-number: QTBUG-30939 Change-Id: I0a02d93b6411119ec018b0cb8fe5c63beeab62ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>bb10
parent
6899117a59
commit
7d8fe4d98f
|
|
@ -617,11 +617,6 @@
|
|||
},
|
||||
"xcb_renderutil": {
|
||||
"label": "XCB Renderutil >= 0.3.9",
|
||||
"test": {
|
||||
"main": [
|
||||
"xcb_render_util_find_standard_format(nullptr, XCB_PICT_STANDARD_ARGB_32);"
|
||||
]
|
||||
},
|
||||
"headers": "xcb/xcb_renderutil.h",
|
||||
"sources": [
|
||||
{ "type": "pkgConfig", "args": "xcb-renderutil >= 0.3.9" },
|
||||
|
|
@ -717,17 +712,6 @@
|
|||
},
|
||||
"xcb_render": {
|
||||
"label": "XCB XRender",
|
||||
"test": {
|
||||
"main": [
|
||||
"xcb_generic_error_t *error = 0;",
|
||||
"xcb_connection_t *connection = 0;",
|
||||
"xcb_render_query_pict_formats_cookie_t formatsCookie =",
|
||||
" xcb_render_query_pict_formats(connection);",
|
||||
"xcb_render_query_pict_formats_reply_t *formatsReply =",
|
||||
" xcb_render_query_pict_formats_reply(",
|
||||
" connection, formatsCookie, &error);"
|
||||
]
|
||||
},
|
||||
"headers": "xcb/render.h",
|
||||
"sources": [
|
||||
{ "type": "pkgConfig", "args": "xcb-render" },
|
||||
|
|
@ -1075,19 +1059,31 @@
|
|||
"xcb/xcb_image.h",
|
||||
"xcb/xcb_keysyms.h",
|
||||
"xcb/randr.h",
|
||||
"xcb/render.h",
|
||||
"xcb/shape.h",
|
||||
"xcb/shm.h",
|
||||
"xcb/sync.h",
|
||||
"xcb/xfixes.h",
|
||||
"xcb/xinerama.h",
|
||||
"xcb/xcb_icccm.h"
|
||||
"xcb/xcb_icccm.h",
|
||||
"xcb/xcb_renderutil.h"
|
||||
],
|
||||
"main": [
|
||||
"int primaryScreen = 0;",
|
||||
"(void) xcb_connect(\"\", &primaryScreen);"
|
||||
"xcb_connection_t *c = xcb_connect(\"\", &primaryScreen);",
|
||||
|
||||
"/* RENDER */",
|
||||
"xcb_generic_error_t *error = nullptr;",
|
||||
"xcb_render_query_pict_formats_cookie_t formatsCookie =",
|
||||
" xcb_render_query_pict_formats(c);",
|
||||
"xcb_render_query_pict_formats_reply_t *formatsReply =",
|
||||
" xcb_render_query_pict_formats_reply(c, formatsCookie, &error);",
|
||||
|
||||
"/* RENDERUTIL: xcb_renderutil.h include won't compile unless version >= 0.3.9 */",
|
||||
"xcb_render_util_find_standard_format(nullptr, XCB_PICT_STANDARD_ARGB_32);"
|
||||
]
|
||||
},
|
||||
"use": "xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama xcb"
|
||||
"use": "xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama xcb"
|
||||
},
|
||||
"x11prefix": {
|
||||
"label": "X11 prefix",
|
||||
|
|
@ -1553,12 +1549,6 @@
|
|||
"condition": "features.xcb-native-painting",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"xcb-render": {
|
||||
"label": "XCB render",
|
||||
"emitIf": "features.xcb",
|
||||
"condition": "!features.system-xcb || (libs.xcb_render && libs.xcb_renderutil)",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"xkb": {
|
||||
"label": "XCB XKB",
|
||||
"emitIf": "features.xcb",
|
||||
|
|
@ -1943,7 +1933,7 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla
|
|||
"section": "X11",
|
||||
"condition": "features.xcb",
|
||||
"entries": [
|
||||
"system-xcb", "egl_x11", "xkb", "xlib", "xcb-render", "xcb-glx", "xcb-xinput", "xcb-xlib", "xcb-native-painting"
|
||||
"system-xcb", "egl_x11", "xkb", "xlib", "xcb-glx", "xcb-xinput", "xcb-xlib", "xcb-native-painting"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,10 +45,8 @@
|
|||
|
||||
#include <xcb/shm.h>
|
||||
#include <xcb/xcb_image.h>
|
||||
#if QT_CONFIG(xcb_render)
|
||||
#include <xcb/render.h>
|
||||
#include <xcb/xcb_renderutil.h>
|
||||
#endif
|
||||
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/shm.h>
|
||||
|
|
@ -956,16 +954,13 @@ QXcbSystemTrayBackingStore::QXcbSystemTrayBackingStore(QWindow *window)
|
|||
|
||||
if (depth != 32) {
|
||||
platformWindow->setParentRelativeBackPixmap();
|
||||
#if QT_CONFIG(xcb_render)
|
||||
initXRenderMode();
|
||||
#endif
|
||||
m_useGrabbedBackgound = !m_usingXRenderMode;
|
||||
}
|
||||
}
|
||||
|
||||
QXcbSystemTrayBackingStore::~QXcbSystemTrayBackingStore()
|
||||
{
|
||||
#if QT_CONFIG(xcb_render)
|
||||
if (m_xrenderPicture) {
|
||||
xcb_render_free_picture(xcb_connection(), m_xrenderPicture);
|
||||
m_xrenderPicture = XCB_NONE;
|
||||
|
|
@ -978,7 +973,6 @@ QXcbSystemTrayBackingStore::~QXcbSystemTrayBackingStore()
|
|||
xcb_render_free_picture(xcb_connection(), m_windowPicture);
|
||||
m_windowPicture = XCB_NONE;
|
||||
}
|
||||
#endif // QT_CONFIG(xcb_render)
|
||||
}
|
||||
|
||||
void QXcbSystemTrayBackingStore::beginPaint(const QRegion ®ion)
|
||||
|
|
@ -1000,7 +994,6 @@ void QXcbSystemTrayBackingStore::render(xcb_window_t window, const QRegion ®i
|
|||
return;
|
||||
}
|
||||
|
||||
#if QT_CONFIG(xcb_render)
|
||||
m_image->put(m_xrenderPixmap, region, offset);
|
||||
const QRect bounds = region.boundingRect();
|
||||
const QPoint target = bounds.topLeft();
|
||||
|
|
@ -1011,7 +1004,6 @@ void QXcbSystemTrayBackingStore::render(xcb_window_t window, const QRegion ®i
|
|||
m_xrenderPicture, 0, m_windowPicture,
|
||||
target.x(), target.y(), 0, 0, target.x(), target.y(),
|
||||
source.width(), source.height());
|
||||
#endif // QT_CONFIG(xcb_render)
|
||||
}
|
||||
|
||||
void QXcbSystemTrayBackingStore::recreateImage(QXcbWindow *win, const QSize &size)
|
||||
|
|
@ -1028,7 +1020,6 @@ void QXcbSystemTrayBackingStore::recreateImage(QXcbWindow *win, const QSize &siz
|
|||
return;
|
||||
}
|
||||
|
||||
#if QT_CONFIG(xcb_render)
|
||||
if (m_xrenderPicture) {
|
||||
xcb_render_free_picture(xcb_connection(), m_xrenderPicture);
|
||||
m_xrenderPicture = XCB_NONE;
|
||||
|
|
@ -1051,10 +1042,8 @@ void QXcbSystemTrayBackingStore::recreateImage(QXcbWindow *win, const QSize &siz
|
|||
m_image->resize(size);
|
||||
else
|
||||
m_image = new QXcbBackingStoreImage(this, size, 32, QImage::Format_ARGB32_Premultiplied);
|
||||
#endif // QT_CONFIG(xcb_render)
|
||||
}
|
||||
|
||||
#if QT_CONFIG(xcb_render)
|
||||
void QXcbSystemTrayBackingStore::initXRenderMode()
|
||||
{
|
||||
if (!connection()->hasXRender())
|
||||
|
|
@ -1098,6 +1087,5 @@ void QXcbSystemTrayBackingStore::initXRenderMode()
|
|||
|
||||
m_usingXRenderMode = true;
|
||||
}
|
||||
#endif // QT_CONFIG(xcb_render)
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -99,14 +99,13 @@ protected:
|
|||
void recreateImage(QXcbWindow *win, const QSize &size) override;
|
||||
|
||||
private:
|
||||
#if QT_CONFIG(xcb_render)
|
||||
void initXRenderMode();
|
||||
|
||||
xcb_pixmap_t m_xrenderPixmap = XCB_NONE;
|
||||
xcb_render_picture_t m_xrenderPicture = XCB_NONE;
|
||||
xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE;
|
||||
xcb_render_picture_t m_windowPicture = XCB_NONE;
|
||||
#endif
|
||||
|
||||
bool m_usingXRenderMode = false;
|
||||
bool m_useGrabbedBackgound = false;
|
||||
QPixmap m_grabbedBackground;
|
||||
|
|
|
|||
|
|
@ -44,12 +44,10 @@
|
|||
#include <xcb/sync.h>
|
||||
#include <xcb/xfixes.h>
|
||||
#include <xcb/xinerama.h>
|
||||
#include <xcb/render.h>
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
#include <xcb/xinput.h>
|
||||
#endif
|
||||
#if QT_CONFIG(xcb_render)
|
||||
#include <xcb/render.h>
|
||||
#endif
|
||||
#if QT_CONFIG(xkb)
|
||||
#define explicit dont_use_cxx_explicit
|
||||
#include <xcb/xkb.h>
|
||||
|
|
@ -139,12 +137,10 @@ QXcbBasicConnection::QXcbBasicConnection(const char *displayName)
|
|||
|
||||
xcb_extension_t *extensions[] = {
|
||||
&xcb_shm_id, &xcb_xfixes_id, &xcb_randr_id, &xcb_shape_id, &xcb_sync_id,
|
||||
&xcb_render_id,
|
||||
#if QT_CONFIG(xkb)
|
||||
&xcb_xkb_id,
|
||||
#endif
|
||||
#if QT_CONFIG(xcb_render)
|
||||
&xcb_render_id,
|
||||
#endif
|
||||
#if QT_CONFIG(xcb_xinput)
|
||||
&xcb_input_id,
|
||||
#endif
|
||||
|
|
@ -293,7 +289,6 @@ void QXcbBasicConnection::initializeShm()
|
|||
|
||||
void QXcbBasicConnection::initializeXRandr()
|
||||
{
|
||||
#if QT_CONFIG(xcb_render)
|
||||
const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_xcbConnection, &xcb_render_id);
|
||||
if (!reply || !reply->present) {
|
||||
qCDebug(lcQpaXcb, "XRender extension not present on the X server");
|
||||
|
|
@ -311,7 +306,6 @@ void QXcbBasicConnection::initializeXRandr()
|
|||
m_hasXRandr = true;
|
||||
m_xrenderVersion.first = xrenderQuery->major_version;
|
||||
m_xrenderVersion.second = xrenderQuery->minor_version;
|
||||
#endif
|
||||
}
|
||||
|
||||
void QXcbBasicConnection::initializeXinerama()
|
||||
|
|
|
|||
|
|
@ -607,14 +607,10 @@ xcb_cursor_t QXcbCursor::createBitmapCursor(QCursor *cursor)
|
|||
QPoint spot = cursor->hotSpot();
|
||||
xcb_cursor_t c = XCB_NONE;
|
||||
if (cursor->pixmap().depth() > 1) {
|
||||
#if QT_CONFIG(xcb_render)
|
||||
if (connection()->hasXRender(0, 5))
|
||||
c = qt_xcb_createCursorXRender(m_screen, cursor->pixmap().toImage(), spot);
|
||||
else
|
||||
qCWarning(lcQpaXcb, "xrender >= 0.5 required to create pixmap cursors");
|
||||
#else
|
||||
qCWarning(lcQpaXcb, "This build of Qt does not support pixmap cursors");
|
||||
#endif
|
||||
} else {
|
||||
xcb_connection_t *conn = xcb_connection();
|
||||
xcb_pixmap_t cp = qt_xcb_XPixmapFromBitmap(m_screen, cursor->bitmap()->toImage());
|
||||
|
|
|
|||
|
|
@ -42,10 +42,9 @@
|
|||
#include <QtGui/QColor>
|
||||
#include <QtGui/private/qimage_p.h>
|
||||
#include <QtGui/private/qdrawhelper_p.h>
|
||||
#if QT_CONFIG(xcb_render)
|
||||
|
||||
#include <xcb/render.h>
|
||||
#include <xcb/xcb_renderutil.h>
|
||||
#endif
|
||||
|
||||
#include "qxcbconnection.h"
|
||||
#include "qxcbintegration.h"
|
||||
|
|
@ -230,7 +229,6 @@ xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image)
|
|||
xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image,
|
||||
const QPoint &spot)
|
||||
{
|
||||
#if QT_CONFIG(xcb_render)
|
||||
xcb_connection_t *conn = screen->xcb_connection();
|
||||
const int w = image.width();
|
||||
const int h = image.height();
|
||||
|
|
@ -283,13 +281,6 @@ xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image,
|
|||
xcb_render_free_picture(conn, pic);
|
||||
xcb_free_pixmap(conn, pix);
|
||||
return cursor;
|
||||
|
||||
#else
|
||||
Q_UNUSED(screen);
|
||||
Q_UNUSED(image);
|
||||
Q_UNUSED(spot);
|
||||
return XCB_NONE;
|
||||
#endif
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -97,9 +97,10 @@ qtConfig(vulkan) {
|
|||
!qtConfig(system-xcb) {
|
||||
QMAKE_USE += xcb-static
|
||||
} else {
|
||||
qtConfig(xcb-render): QMAKE_USE += xcb_render xcb_renderutil
|
||||
qtConfig(xcb-xinput): QMAKE_USE += xcb_xinput
|
||||
QMAKE_USE += xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama
|
||||
QMAKE_USE += \
|
||||
xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil \
|
||||
xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama
|
||||
}
|
||||
QMAKE_USE += xcb
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue