summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/xcb')
-rw-r--r--src/plugins/platforms/xcb/.prev_CMakeLists.txt167
-rw-r--r--src/plugins/platforms/xcb/CMakeLists.txt193
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/CMakeLists.txt8
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt28
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt41
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp2
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp8
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbeventqueue.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbeventqueue.h3
-rw-r--r--src/plugins/platforms/xcb/qxcbimage.cpp2
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp24
-rw-r--r--src/plugins/platforms/xcb/xcb_qpa_lib.pro3
13 files changed, 469 insertions, 18 deletions
diff --git a/src/plugins/platforms/xcb/.prev_CMakeLists.txt b/src/plugins/platforms/xcb/.prev_CMakeLists.txt
new file mode 100644
index 0000000000..85290fae84
--- /dev/null
+++ b/src/plugins/platforms/xcb/.prev_CMakeLists.txt
@@ -0,0 +1,167 @@
+# Generated from xcb.pro.
+
+#####################################################################
+## XcbQpa Module:
+#####################################################################
+
+qt_add_module(XcbQpa
+ INTERNAL_MODULE
+ NO_MODULE_HEADERS
+ SOURCES
+ gl_integrations/qxcbglintegration.cpp gl_integrations/qxcbglintegration.h
+ gl_integrations/qxcbglintegrationfactory.cpp gl_integrations/qxcbglintegrationfactory.h
+ gl_integrations/qxcbglintegrationplugin.h
+ gl_integrations/qxcbnativeinterfacehandler.cpp gl_integrations/qxcbnativeinterfacehandler.h
+ qxcbatom.cpp qxcbatom.h
+ qxcbbackingstore.cpp qxcbbackingstore.h
+ qxcbclipboard.cpp qxcbclipboard.h
+ qxcbconnection.cpp qxcbconnection.h
+ qxcbconnection_basic.cpp qxcbconnection_basic.h
+ qxcbconnection_screens.cpp
+ qxcbconnection_xi2.cpp
+ qxcbcursor.cpp qxcbcursor.h
+ qxcbeventdispatcher.cpp qxcbeventdispatcher.h
+ qxcbeventqueue.cpp qxcbeventqueue.h
+ qxcbimage.cpp qxcbimage.h
+ qxcbintegration.cpp qxcbintegration.h
+ qxcbkeyboard.cpp qxcbkeyboard.h
+ qxcbmime.cpp qxcbmime.h
+ qxcbnativeinterface.cpp qxcbnativeinterface.h
+ qxcbobject.h
+ qxcbscreen.cpp qxcbscreen.h
+ qxcbsystemtraytracker.cpp qxcbsystemtraytracker.h
+ qxcbwindow.cpp qxcbwindow.h
+ qxcbwmsupport.cpp qxcbwmsupport.h
+ qxcbxsettings.cpp qxcbxsettings.h
+ DEFINES
+ QT_BUILD_XCB_PLUGIN
+ QT_NO_FOREACH
+ INCLUDE_DIRECTORIES
+ gl_integrations
+ PUBLIC_LIBRARIES
+ PkgConfig::XKB_COMMON_X11
+ Qt::CorePrivate
+ Qt::EdidSupportPrivate
+ Qt::FontDatabaseSupportPrivate
+ Qt::GuiPrivate
+ Qt::ServiceSupportPrivate
+ Qt::ThemeSupportPrivate
+ Qt::XkbCommonSupportPrivate
+ XCB::ICCCM
+ XCB::IMAGE
+ XCB::KEYSYMS
+ XCB::RANDR
+ XCB::RENDER
+ XCB::RENDERUTIL
+ XCB::SHAPE
+ XCB::SHM
+ XCB::SYNC
+ XCB::XCB
+ XCB::XFIXES
+ XCB::XINERAMA
+ XCB::XINPUT
+ XCB::XKB
+ XKB::XKB
+)
+
+## Scopes:
+#####################################################################
+
+qt_extend_target(XcbQpa CONDITION TARGET Qt::PlatformCompositorSupportPrivate
+ PUBLIC_LIBRARIES
+ Qt::PlatformCompositorSupportPrivate
+)
+
+qt_extend_target(XcbQpa CONDITION TARGET Qt::LinuxAccessibilitySupportPrivate
+ PUBLIC_LIBRARIES
+ Qt::LinuxAccessibilitySupportPrivate
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_vulkan
+ SOURCES
+ qxcbvulkaninstance.cpp qxcbvulkaninstance.h
+ qxcbvulkanwindow.cpp qxcbvulkanwindow.h
+ PUBLIC_LIBRARIES
+ Qt::VulkanSupportPrivate
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_glib
+ LIBRARIES
+ GLIB2::GLIB2
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_draganddrop
+ SOURCES
+ qxcbdrag.cpp qxcbdrag.h
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_xcb_xlib
+ PUBLIC_LIBRARIES
+ X11::XCB
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_xcb_sm
+ SOURCES
+ qxcbsessionmanager.cpp qxcbsessionmanager.h
+ PUBLIC_LIBRARIES
+ ${X11_SM_LIB} ${X11_ICE_LIB}
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_dlopen
+ PUBLIC_LIBRARIES
+ ${CMAKE_DL_LIBS}
+)
+
+qt_extend_target(XcbQpa CONDITION CLANG AND NOT ICC
+ COMPILE_OPTIONS
+ -ftemplate-depth=1024
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting
+ SOURCES
+ nativepainting/qbackingstore_x11.cpp nativepainting/qbackingstore_x11_p.h
+ nativepainting/qcolormap_x11.cpp nativepainting/qcolormap_x11_p.h
+ nativepainting/qpaintengine_x11.cpp nativepainting/qpaintengine_x11_p.h
+ nativepainting/qpixmap_x11.cpp nativepainting/qpixmap_x11_p.h
+ nativepainting/qt_x11_p.h
+ nativepainting/qtessellator.cpp nativepainting/qtessellator_p.h
+ nativepainting/qxcbnativepainting.cpp nativepainting/qxcbnativepainting.h
+ INCLUDE_DIRECTORIES
+ nativepainting
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting AND QT_FEATURE_xrender
+ PUBLIC_LIBRARIES
+ PkgConfig::XRender
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_fontconfig AND QT_FEATURE_xcb_native_painting
+ LIBRARIES
+ WrapFreetype::WrapFreetype
+)
+#####################################################################
+## QXcbIntegrationPlugin Plugin:
+#####################################################################
+
+qt_add_plugin(QXcbIntegrationPlugin
+ OUTPUT_NAME qxcb
+ TYPE platforms
+ SOURCES
+ qxcbmain.cpp
+ DEFINES
+ QT_NO_FOREACH
+ PUBLIC_LIBRARIES
+ Qt::CorePrivate
+ Qt::GuiPrivate
+ Qt::XcbQpaPrivate
+)
+
+#### Keys ignored in scope 20:.:.:xcb-plugin.pro:<TRUE>:
+# OTHER_FILES = "xcb.json" "README"
+
+## Scopes:
+#####################################################################
+
+#### Keys ignored in scope 22:.:.:xcb-plugin.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN:
+# PLUGIN_EXTENDS = "-"
+add_subdirectory(gl_integrations)
diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt
new file mode 100644
index 0000000000..a7cb58ba29
--- /dev/null
+++ b/src/plugins/platforms/xcb/CMakeLists.txt
@@ -0,0 +1,193 @@
+# Generated from xcb.pro.
+
+#####################################################################
+## XcbQpa Module:
+#####################################################################
+
+qt_add_module(XcbQpa
+ INTERNAL_MODULE
+ NO_MODULE_HEADERS
+ SOURCES
+ gl_integrations/qxcbglintegration.cpp gl_integrations/qxcbglintegration.h
+ gl_integrations/qxcbglintegrationfactory.cpp gl_integrations/qxcbglintegrationfactory.h
+ gl_integrations/qxcbglintegrationplugin.h
+ gl_integrations/qxcbnativeinterfacehandler.cpp gl_integrations/qxcbnativeinterfacehandler.h
+ qxcbatom.cpp qxcbatom.h
+ qxcbbackingstore.cpp qxcbbackingstore.h
+ qxcbclipboard.cpp qxcbclipboard.h
+ qxcbconnection.cpp qxcbconnection.h
+ qxcbconnection_basic.cpp qxcbconnection_basic.h
+ qxcbconnection_screens.cpp
+ qxcbconnection_xi2.cpp
+ qxcbcursor.cpp qxcbcursor.h
+ qxcbeventdispatcher.cpp qxcbeventdispatcher.h
+ qxcbeventqueue.cpp qxcbeventqueue.h
+ qxcbimage.cpp qxcbimage.h
+ qxcbintegration.cpp qxcbintegration.h
+ qxcbkeyboard.cpp qxcbkeyboard.h
+ qxcbmime.cpp qxcbmime.h
+ qxcbnativeinterface.cpp qxcbnativeinterface.h
+ qxcbobject.h
+ qxcbscreen.cpp qxcbscreen.h
+ qxcbsystemtraytracker.cpp qxcbsystemtraytracker.h
+ qxcbwindow.cpp qxcbwindow.h
+ qxcbwmsupport.cpp qxcbwmsupport.h
+ qxcbxsettings.cpp qxcbxsettings.h
+ DEFINES
+ QT_BUILD_XCB_PLUGIN
+ QT_NO_FOREACH
+ INCLUDE_DIRECTORIES
+ gl_integrations
+ PUBLIC_LIBRARIES
+ PkgConfig::XKB_COMMON_X11
+ Qt::CorePrivate
+ Qt::EdidSupportPrivate
+ Qt::FontDatabaseSupportPrivate
+ Qt::GuiPrivate
+ Qt::ServiceSupportPrivate
+ Qt::ThemeSupportPrivate
+ Qt::XkbCommonSupportPrivate
+ XCB::ICCCM
+ XCB::IMAGE
+ XCB::KEYSYMS
+ XCB::RANDR
+ XCB::RENDER
+ XCB::RENDERUTIL
+ XCB::SHAPE
+ XCB::SHM
+ XCB::SYNC
+ XCB::XCB
+ XCB::XFIXES
+ XCB::XINERAMA
+ $<$<TARGET_EXISTS:XCB::XINPUT>:XCB::XINPUT> # special case
+ XCB::XKB
+ XKB::XKB
+)
+
+## Scopes:
+#####################################################################
+
+qt_extend_target(XcbQpa CONDITION TARGET Qt::PlatformCompositorSupportPrivate
+ PUBLIC_LIBRARIES
+ Qt::PlatformCompositorSupportPrivate
+)
+
+qt_extend_target(XcbQpa CONDITION TARGET Qt::LinuxAccessibilitySupportPrivate
+ PUBLIC_LIBRARIES
+ Qt::LinuxAccessibilitySupportPrivate
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_vulkan
+ SOURCES
+ qxcbvulkaninstance.cpp qxcbvulkaninstance.h
+ qxcbvulkanwindow.cpp qxcbvulkanwindow.h
+ PUBLIC_LIBRARIES
+ Qt::VulkanSupportPrivate
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_glib
+ LIBRARIES
+ GLIB2::GLIB2
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_draganddrop
+ SOURCES
+ qxcbdrag.cpp qxcbdrag.h
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_xcb_xlib
+ PUBLIC_LIBRARIES
+ X11::XCB
+ # special case begin
+ # 'QMAKE_USE += xcb_xlib' in qmake implies also += xlib (aka X11)
+ # due to "use": "xcb xlib" in src/gui/configure.json.
+ # That's not yet handled by the conversion scripts unfortunately.
+ X11::X11
+ # special case end
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_xcb_sm
+ SOURCES
+ qxcbsessionmanager.cpp qxcbsessionmanager.h
+ PUBLIC_LIBRARIES
+ ${X11_SM_LIB} ${X11_ICE_LIB}
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_dlopen
+ PUBLIC_LIBRARIES
+ ${CMAKE_DL_LIBS}
+)
+
+qt_extend_target(XcbQpa CONDITION CLANG AND NOT ICC
+ COMPILE_OPTIONS
+ -ftemplate-depth=1024
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting
+ SOURCES
+ nativepainting/qbackingstore_x11.cpp nativepainting/qbackingstore_x11_p.h
+ nativepainting/qcolormap_x11.cpp nativepainting/qcolormap_x11_p.h
+ nativepainting/qpaintengine_x11.cpp nativepainting/qpaintengine_x11_p.h
+ nativepainting/qpixmap_x11.cpp nativepainting/qpixmap_x11_p.h
+ nativepainting/qt_x11_p.h
+ nativepainting/qtessellator.cpp nativepainting/qtessellator_p.h
+ nativepainting/qxcbnativepainting.cpp nativepainting/qxcbnativepainting.h
+ INCLUDE_DIRECTORIES
+ nativepainting
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_xcb_native_painting AND QT_FEATURE_xrender
+ PUBLIC_LIBRARIES
+ PkgConfig::XRender
+)
+
+qt_extend_target(XcbQpa CONDITION QT_FEATURE_fontconfig AND QT_FEATURE_xcb_native_painting
+ LIBRARIES
+ WrapFreetype::WrapFreetype
+)
+
+# special case begin
+if (NOT QT_FEATURE_system_xcb_input)
+ set(xinput_source "${PROJECT_SOURCE_DIR}/src/3rdparty/xcb/libxcb/xinput.c")
+ set_source_files_properties(
+ "${xinput_source}"
+ PROPERTIES COMPILE_OPTIONS "-w"
+ )
+ target_sources(XcbQpa PRIVATE "${xinput_source}")
+ target_include_directories(XcbQpa PRIVATE
+ "${PROJECT_SOURCE_DIR}/src/3rdparty/xcb/include"
+ )
+endif()
+# special case end
+
+#####################################################################
+## QXcbIntegrationPlugin Plugin:
+#####################################################################
+
+qt_add_plugin(QXcbIntegrationPlugin
+ OUTPUT_NAME qxcb
+ TYPE platforms
+ DEFAULT_IF ${QT_QPA_DEFAULT_PLATFORM} MATCHES xcb # special case
+ SOURCES
+ qxcbmain.cpp
+ DEFINES
+ QT_NO_FOREACH
+ PUBLIC_LIBRARIES
+ Qt::CorePrivate
+ Qt::GuiPrivate
+ Qt::XcbQpaPrivate
+)
+
+#### Keys ignored in scope 20:.:.:xcb-plugin.pro:<TRUE>:
+# OTHER_FILES = "xcb.json" "README"
+
+## Scopes:
+#####################################################################
+
+#### Keys ignored in scope 22:.:.:xcb-plugin.pro:NOT TARGET___equals____ss_QT_DEFAULT_QPA_PLUGIN:
+# PLUGIN_EXTENDS = "-"
+add_subdirectory(gl_integrations)
+if(OFF)
+ add_subdirectory(xcb-static) # special case TODO: xcb-static sub folder
+endif()
+
diff --git a/src/plugins/platforms/xcb/gl_integrations/CMakeLists.txt b/src/plugins/platforms/xcb/gl_integrations/CMakeLists.txt
new file mode 100644
index 0000000000..210a924550
--- /dev/null
+++ b/src/plugins/platforms/xcb/gl_integrations/CMakeLists.txt
@@ -0,0 +1,8 @@
+# Generated from gl_integrations.pro.
+
+if(QT_FEATURE_xcb_egl_plugin)
+ add_subdirectory(xcb_egl)
+endif()
+if(QT_FEATURE_xcb_glx_plugin)
+ add_subdirectory(xcb_glx)
+endif()
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt
new file mode 100644
index 0000000000..a78d01ec87
--- /dev/null
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt
@@ -0,0 +1,28 @@
+# Generated from xcb_egl.pro.
+
+#####################################################################
+## QXcbEglIntegrationPlugin Plugin:
+#####################################################################
+
+qt_add_plugin(QXcbEglIntegrationPlugin
+ OUTPUT_NAME qxcb-egl-integration
+ TYPE xcbglintegrations
+ SOURCES
+ qxcbeglcontext.h
+ qxcbeglintegration.cpp qxcbeglintegration.h
+ qxcbeglmain.cpp
+ qxcbeglnativeinterfacehandler.cpp qxcbeglnativeinterfacehandler.h
+ qxcbeglwindow.cpp qxcbeglwindow.h
+ DEFINES
+ QT_NO_FOREACH
+ INCLUDE_DIRECTORIES
+ ..
+ ../..
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::CorePrivate
+ Qt::EglSupportPrivate
+ Qt::Gui
+ Qt::GuiPrivate
+ Qt::XcbQpaPrivate
+)
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt
new file mode 100644
index 0000000000..b3361dbd99
--- /dev/null
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt
@@ -0,0 +1,41 @@
+# Generated from xcb_glx.pro.
+
+#####################################################################
+## QXcbGlxIntegrationPlugin Plugin:
+#####################################################################
+
+qt_add_plugin(QXcbGlxIntegrationPlugin
+ OUTPUT_NAME qxcb-glx-integration
+ TYPE xcbglintegrations
+ SOURCES
+ qglxintegration.cpp qglxintegration.h
+ qxcbglxintegration.cpp qxcbglxintegration.h
+ qxcbglxmain.cpp
+ qxcbglxnativeinterfacehandler.cpp qxcbglxnativeinterfacehandler.h
+ qxcbglxwindow.cpp qxcbglxwindow.h
+ DEFINES
+ QT_NO_FOREACH
+ INCLUDE_DIRECTORIES
+ ..
+ ../..
+ PUBLIC_LIBRARIES
+ Qt::Core
+ Qt::CorePrivate
+ Qt::GlxSupportPrivate
+ Qt::Gui
+ Qt::GuiPrivate
+ Qt::XcbQpaPrivate
+)
+
+## Scopes:
+#####################################################################
+
+qt_extend_target(QXcbGlxIntegrationPlugin CONDITION QT_FEATURE_xcb_glx
+ PUBLIC_LIBRARIES
+ XCB::GLX
+)
+
+qt_extend_target(QXcbGlxIntegrationPlugin CONDITION QT_FEATURE_dlopen AND NOT static
+ PUBLIC_LIBRARIES
+ ${CMAKE_DL_LIBS}
+)
diff --git a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp
index 82b6d60bcd..7bf2b38d7d 100644
--- a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp
+++ b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp
@@ -2016,7 +2016,7 @@ Q_GUI_EXPORT void qt_x11_drawImage(const QRect &rect, const QPoint &pos, const Q
|| (image_byte_order == LSBFirst && bgr_layout))
{
im = image.copy(rect);
- const int iw = im.bytesPerLine() / 4;
+ const qsizetype iw = im.bytesPerLine() / 4;
uint *data = (uint *)im.bits();
for (int i=0; i < h; i++) {
uint *p = data;
diff --git a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
index f86bedbdcd..467e93e64f 100644
--- a/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
+++ b/src/plugins/platforms/xcb/nativepainting/qpixmap_x11.cpp
@@ -1747,7 +1747,7 @@ XID QX11PlatformPixmap::createBitmapFromImage(const QImage &image)
int w = img.width();
int h = img.height();
int bpl = (w + 7) / 8;
- int ibpl = img.bytesPerLine();
+ qsizetype ibpl = img.bytesPerLine();
if (bpl != ibpl) {
tmp_bits = new uchar[bpl*h];
bits = (char *)tmp_bits;
@@ -2017,7 +2017,7 @@ QImage QX11PlatformPixmap::toImage(const QXImageWrapper &xiWrapper, const QRect
}
} else if (xi->bits_per_pixel == d) { // compatible depth
char *xidata = xi->data; // copy each scanline
- int bpl = qMin(int(image.bytesPerLine()),xi->bytes_per_line);
+ qsizetype bpl = qMin(image.bytesPerLine(),xi->bytes_per_line);
for (int y=0; y<xi->height; y++) {
memcpy(image.scanLine(y), xidata, bpl);
xidata += xi->bytes_per_line;
@@ -2038,10 +2038,10 @@ QImage QX11PlatformPixmap::toImage(const QXImageWrapper &xiWrapper, const QRect
uchar *end;
uchar use[256]; // pixel-in-use table
uchar pix[256]; // pixel translation table
- int ncols, bpl;
+ int ncols;
memset(use, 0, 256);
memset(pix, 0, 256);
- bpl = image.bytesPerLine();
+ qsizetype bpl = image.bytesPerLine();
if (x11_mask) { // which pixels are used?
for (int i = 0; i < xi->height; i++) {
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index 8f55bc2e96..7330c3c9a3 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -537,7 +537,7 @@ void QXcbBackingStoreImage::ensureGC(xcb_drawable_t dst)
static inline void copy_unswapped(char *dst, int dstBytesPerLine, const QImage &img, const QRect &rect)
{
const uchar *srcData = img.constBits();
- const int srcBytesPerLine = img.bytesPerLine();
+ const qsizetype srcBytesPerLine = img.bytesPerLine();
const int leftOffset = rect.left() * img.depth() >> 3;
const int bottom = rect.bottom() + 1;
@@ -553,7 +553,7 @@ template <class Pixel>
static inline void copy_swapped(char *dst, const int dstStride, const QImage &img, const QRect &rect)
{
const uchar *srcData = img.constBits();
- const int srcBytesPerLine = img.bytesPerLine();
+ const qsizetype srcBytesPerLine = img.bytesPerLine();
const int left = rect.left();
const int width = rect.width();
diff --git a/src/plugins/platforms/xcb/qxcbeventqueue.cpp b/src/plugins/platforms/xcb/qxcbeventqueue.cpp
index 759ee3cc95..f0cb5edd2a 100644
--- a/src/plugins/platforms/xcb/qxcbeventqueue.cpp
+++ b/src/plugins/platforms/xcb/qxcbeventqueue.cpp
@@ -62,8 +62,8 @@ static bool dispatcherOwnerDestructing = false;
when accessing the tail node. It does not dequeue the last node and does not
access (read or write) the tail node's 'next' member. This lets the reader
add more items at the same time as the main thread is dequeuing nodes from
- the head. A custom linked list implementation is used, because QLinkedList
- does not have any thread-safety guarantees and the custom list is more
+ the head. A custom linked list implementation is used, because std::list
+ does not have any thread-safety guarantees. The custom list is
lightweight - no reference counting, back links, etc.
Memory management:
diff --git a/src/plugins/platforms/xcb/qxcbeventqueue.h b/src/plugins/platforms/xcb/qxcbeventqueue.h
index 11d0b8e963..e7327b3fd6 100644
--- a/src/plugins/platforms/xcb/qxcbeventqueue.h
+++ b/src/plugins/platforms/xcb/qxcbeventqueue.h
@@ -49,6 +49,7 @@
#include <xcb/xcb.h>
#include <atomic>
+#include <limits>
QT_BEGIN_NAMESPACE
@@ -106,7 +107,7 @@ public:
bool peekEventQueue(PeekerCallback peeker, void *peekerData = nullptr,
PeekOptions option = PeekDefault, qint32 peekerId = -1);
- void waitForNewEvents(unsigned long time = ULONG_MAX);
+ void waitForNewEvents(unsigned long time = std::numeric_limits<unsigned long>::max());
private:
QXcbEventNode *qXcbEventNodeFactory(xcb_generic_event_t *event);
diff --git a/src/plugins/platforms/xcb/qxcbimage.cpp b/src/plugins/platforms/xcb/qxcbimage.cpp
index b0e610dd51..5b5c37fac4 100644
--- a/src/plugins/platforms/xcb/qxcbimage.cpp
+++ b/src/plugins/platforms/xcb/qxcbimage.cpp
@@ -212,7 +212,7 @@ xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image)
}
const int width = bitmap.width();
const int height = bitmap.height();
- const int bytesPerLine = bitmap.bytesPerLine();
+ const qsizetype bytesPerLine = bitmap.bytesPerLine();
int destLineSize = width / 8;
if (width % 8)
++destLineSize;
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index 3fd989e1f9..cea0511822 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -61,6 +61,9 @@
#include <QtFontDatabaseSupport/private/qgenericunixfontdatabase_p.h>
#include <QtServiceSupport/private/qgenericunixservices_p.h>
+#if QT_CONFIG(opengl)
+#include <QtPlatformCompositorSupport/qpa/qplatformbackingstoreopenglsupport.h>
+#endif
#include <stdio.h>
@@ -288,16 +291,23 @@ QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLCont
QPlatformBackingStore *QXcbIntegration::createPlatformBackingStore(QWindow *window) const
{
- const bool isTrayIconWindow = QXcbWindow::isTrayIconWindow(window);
- if (isTrayIconWindow)
- return new QXcbSystemTrayBackingStore(window);
+ QPlatformBackingStore *backingStore = nullptr;
+ const bool isTrayIconWindow = QXcbWindow::isTrayIconWindow(window);
+ if (isTrayIconWindow) {
+ backingStore = new QXcbSystemTrayBackingStore(window);
#if QT_CONFIG(xcb_native_painting)
- if (nativePaintingEnabled())
- return new QXcbNativeBackingStore(window);
+ } else if (nativePaintingEnabled()) {
+ backingStore = new QXcbNativeBackingStore(window);
#endif
-
- return new QXcbBackingStore(window);
+ } else {
+ backingStore = new QXcbBackingStore(window);
+ }
+ Q_ASSERT(backingStore);
+#ifndef QT_NO_OPENGL
+ backingStore->setOpenGLSupport(new QPlatformBackingStoreOpenGLSupport(backingStore));
+#endif
+ return backingStore;
}
QPlatformOffscreenSurface *QXcbIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const
diff --git a/src/plugins/platforms/xcb/xcb_qpa_lib.pro b/src/plugins/platforms/xcb/xcb_qpa_lib.pro
index a5d05faa9c..1f651e7697 100644
--- a/src/plugins/platforms/xcb/xcb_qpa_lib.pro
+++ b/src/plugins/platforms/xcb/xcb_qpa_lib.pro
@@ -9,6 +9,9 @@ QT += \
edid_support-private \
xkbcommon_support-private
+qtHaveModule(platformcompositor_support-private): \
+ QT += platformcompositor_support-private
+
qtHaveModule(linuxaccessibility_support-private): \
QT += linuxaccessibility_support-private