From 26cf0f0d5a81907b5ee5c4ffb3aeb13c6d681d89 Mon Sep 17 00:00:00 2001 From: hjk Date: Sat, 23 Nov 2013 01:39:30 +0100 Subject: xcb: Rename main.cpp to xcbmain.cpp Files with same base name cause extra trouble for debuggers. It can be avoided here. Change-Id: I1b7a6f28ac41bacbfd2603feb8b786c31d3769e3 Reviewed-by: Friedemann Kleint Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/main.cpp | 65 -------------------------------- src/plugins/platforms/xcb/qxcbmain.cpp | 65 ++++++++++++++++++++++++++++++++ src/plugins/platforms/xcb/xcb-plugin.pro | 2 +- 3 files changed, 66 insertions(+), 66 deletions(-) delete mode 100644 src/plugins/platforms/xcb/main.cpp create mode 100644 src/plugins/platforms/xcb/qxcbmain.cpp (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/main.cpp b/src/plugins/platforms/xcb/main.cpp deleted file mode 100644 index f21ea03cf5..0000000000 --- a/src/plugins/platforms/xcb/main.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the plugins of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "qxcbintegration.h" - -QT_BEGIN_NAMESPACE - -class QXcbIntegrationPlugin : public QPlatformIntegrationPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2" FILE "xcb.json") -public: - QPlatformIntegration *create(const QString&, const QStringList&, int &, char **); -}; - -QPlatformIntegration* QXcbIntegrationPlugin::create(const QString& system, const QStringList& parameters, int &argc, char **argv) -{ - if (!system.compare(QLatin1String("xcb"), Qt::CaseInsensitive)) - return new QXcbIntegration(parameters, argc, argv); - - return 0; -} - -QT_END_NAMESPACE - -#include "main.moc" diff --git a/src/plugins/platforms/xcb/qxcbmain.cpp b/src/plugins/platforms/xcb/qxcbmain.cpp new file mode 100644 index 0000000000..54c1629bf0 --- /dev/null +++ b/src/plugins/platforms/xcb/qxcbmain.cpp @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "qxcbintegration.h" + +QT_BEGIN_NAMESPACE + +class QXcbIntegrationPlugin : public QPlatformIntegrationPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.2" FILE "xcb.json") +public: + QPlatformIntegration *create(const QString&, const QStringList&, int &, char **); +}; + +QPlatformIntegration* QXcbIntegrationPlugin::create(const QString& system, const QStringList& parameters, int &argc, char **argv) +{ + if (!system.compare(QLatin1String("xcb"), Qt::CaseInsensitive)) + return new QXcbIntegration(parameters, argc, argv); + + return 0; +} + +QT_END_NAMESPACE + +#include "qxcbmain.moc" diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro index 4727262f3f..a2ae7e908c 100644 --- a/src/plugins/platforms/xcb/xcb-plugin.pro +++ b/src/plugins/platforms/xcb/xcb-plugin.pro @@ -17,7 +17,7 @@ SOURCES = \ qxcbwindow.cpp \ qxcbbackingstore.cpp \ qxcbwmsupport.cpp \ - main.cpp \ + qxcbmain.cpp \ qxcbnativeinterface.cpp \ qxcbcursor.cpp \ qxcbimage.cpp \ -- cgit v1.2.3 From af113cfc0f0de5bfcb4739c4cc1d88e76a514a19 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 5 Mar 2014 13:57:36 +0100 Subject: Use None instead of GLX_NONE GLX_NONE is not 0, so it doesn't work as end-of-list marker The documentation explicitly mentions to use None or NULL Fixes valgrind warning ==22686== Conditional jump or move depends on uninitialised value(s) ==22686== at 0x78949AF: glXCreatePbuffer (glx_pbuffer.c:709) ==22686== by 0xDD7F0E1: QGLXPbuffer::QGLXPbuffer(QOffscreenSurface*) (qglxintegration.cpp:515) ==22686== by 0xDD624B0: QXcbIntegration::createPlatformOffscreenSurface(QOffscreenSurface*) const (qxcbintegration.cpp:259) ==22686== by 0x4F1D6A2: QOffscreenSurface::create() (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.2.1) ==22686== by 0xDD80248: QGLXContext::queryDummyContext() (qglxintegration.cpp:454) ==22686== by 0xDD803F0: QGLXContext::supportsThreading() (qglxintegration.cpp:488) ==22686== by 0x5BD9927: QSGRenderLoop::instance() (in /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5.2.1) ==22686== by 0x5BF969E: QQuickWindowPrivate::init(QQuickWindow*) (in /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5.2.1) ==22686== by 0x5C97BFC: QQuickView::QQuickView(QWindow*) (in /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5.2.1) ==22686== by 0x40636F: startShell(int, char const**, void*) (main.cpp:91) ==22686== by 0x407125: main (main.cpp:193) Change-Id: Ib4f5ae50f7e31d3fbeb5acf67753e1d8b9e434b0 Reviewed-by: Laszlo Agocs --- src/plugins/platforms/xcb/qglxintegration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp index ed2f685770..eaa4d05311 100644 --- a/src/plugins/platforms/xcb/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/qglxintegration.cpp @@ -537,7 +537,7 @@ QGLXPbuffer::QGLXPbuffer(QOffscreenSurface *offscreenSurface) GLX_PBUFFER_HEIGHT, offscreenSurface->size().height(), GLX_LARGEST_PBUFFER, False, GLX_PRESERVED_CONTENTS, False, - GLX_NONE + None }; m_pbuffer = glXCreatePbuffer(DISPLAY_FROM_XCB(m_screen), config, attributes); -- cgit v1.2.3 From e8fb9a3c7c07a9de7185f21e619873adc0b9ea03 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Wed, 26 Feb 2014 16:55:34 +0100 Subject: Update bundled libxcb-xkb version to 1.10 To utilize the new xkb_x11_* API from libxkbcommon 0.4.0, we need to update the bundled libxcb-xkb version to 1.10, which is the minimal required version. Change-Id: I0b72a2684bd11cbe5ae65d6dab7292be3a76464c Reviewed-by: Lars Knoll --- src/plugins/platforms/xcb/xcb-static/xcb-static.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro b/src/plugins/platforms/xcb/xcb-static/xcb-static.pro index 2fd5519053..19852b74b1 100644 --- a/src/plugins/platforms/xcb/xcb-static/xcb-static.pro +++ b/src/plugins/platforms/xcb/xcb-static/xcb-static.pro @@ -1,6 +1,7 @@ # # Statically compile in code for -# libxcb-fixes, libxcb-randr, libxcb-shm, libxcb-sync, libxcb-image, libxcb-keysyms, libxcb-icccm, libxcb-renderutil +# libxcb-fixes, libxcb-randr, libxcb-shm, libxcb-sync, libxcb-image, +# libxcb-keysyms, libxcb-icccm, libxcb-renderutil, libxcb-xkb # TEMPLATE = lib TARGET = xcb-static -- cgit v1.2.3 From e9ce4fcffa3459774e69f712f81a6a0a542dbcd8 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Thu, 6 Mar 2014 18:53:39 +0100 Subject: Remove usage of QT_NO_SHAPE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First of all QT_NO_SHAPE was never set in configure script, which means that !contains(DEFINES, QT_NO_SHAPE):LIBS += -lxcb-shape always was true and we were linking to -lxcb-shape no matter what. Secondly, we are providing shape.c in qtbase/src/3rdparty/xcb/libxcb, so users always have an -qt-xcb option available to get this extension. Change-Id: I7d14a0ac5ca6e36fb9c053225916cae41028b532 Reviewed-by: Uli Schlachter Reviewed-by: Jørgen Lind --- src/plugins/platforms/xcb/qxcbwindow.cpp | 8 +------- src/plugins/platforms/xcb/qxcbwindow.h | 3 --- src/plugins/platforms/xcb/xcb-plugin.pro | 3 +-- 3 files changed, 2 insertions(+), 12 deletions(-) (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp index 29f71e6972..aabcb84a08 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.cpp +++ b/src/plugins/platforms/xcb/qxcbwindow.cpp @@ -64,9 +64,7 @@ #include #undef class #include -#ifndef QT_NO_SHAPE -# include -#endif // QT_NO_SHAPE +#include // xcb-icccm 3.8 support #ifdef XCB_ICCCM_NUM_WM_SIZE_HINTS_ELEMENTS @@ -2077,8 +2075,6 @@ void QXcbWindow::handleXEmbedMessage(const xcb_client_message_event_t *event) } } -#if !defined(QT_NO_SHAPE) - static inline xcb_rectangle_t qRectToXCBRectangle(const QRect &r) { xcb_rectangle_t result; @@ -2123,8 +2119,6 @@ void QXcbWindow::setMask(const QRegion ®ion) } } -#endif // !QT_NO_SHAPE - void QXcbWindow::setAlertState(bool enabled) { if (m_alertState == enabled) diff --git a/src/plugins/platforms/xcb/qxcbwindow.h b/src/plugins/platforms/xcb/qxcbwindow.h index 45d44b213f..a90ad7b5ed 100644 --- a/src/plugins/platforms/xcb/qxcbwindow.h +++ b/src/plugins/platforms/xcb/qxcbwindow.h @@ -114,10 +114,7 @@ public: bool startSystemResize(const QPoint &pos, Qt::Corner corner); void setOpacity(qreal level); - -#if !defined(QT_NO_SHAPE) void setMask(const QRegion ®ion); -#endif // !QT_NO_SHAPE void setAlertState(bool enabled); bool isAlertState() const { return m_alertState; } diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro index a2ae7e908c..bfbec91e3c 100644 --- a/src/plugins/platforms/xcb/xcb-plugin.pro +++ b/src/plugins/platforms/xcb/xcb-plugin.pro @@ -121,8 +121,7 @@ contains(QT_CONFIG, xcb-qt) { INCLUDEPATH += $$XCB_DIR/include $$XCB_DIR/sysinclude LIBS += -lxcb -L$$OUT_PWD/xcb-static -lxcb-static } else { - LIBS += -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr - !contains(DEFINES, QT_NO_SHAPE):LIBS += -lxcb-shape + LIBS += -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr -lxcb-shape contains(DEFINES, QT_NO_XKB) { LIBS += -lxcb-keysyms } else { -- cgit v1.2.3 From 2f63d04ff1e9c28f5c5c6465306f6e19ba781287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 6 Mar 2014 14:46:46 +0100 Subject: Export rootWindow to the QXcbNativeInterface This change exports the root window to the native interface as there is QX11Info::appRootWindow which so far goes over the QDesktopWidget to get the window id of the root window. Which is a rather hackish way considering that the root window is known to the QXcbConnection. But even more it's a very fragile way and can result in crashes on startup of applications if the application accesses the appRootWindow too early. Change-Id: Ibb09a7fa714cb355f579298fc6df33bf80f73f58 Reviewed-by: Friedemann Kleint Reviewed-by: David Faure Reviewed-by: Gatis Paeglis --- src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 15 ++++++++++++++- src/plugins/platforms/xcb/qxcbnativeinterface.h | 4 +++- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 7d69564c57..b45bd6a82e 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -80,7 +80,8 @@ static int resourceType(const QByteArray &key) QByteArrayLiteral("glxcontext"), QByteArrayLiteral("apptime"), QByteArrayLiteral("appusertime"), QByteArrayLiteral("hintstyle"), QByteArrayLiteral("startupid"), QByteArrayLiteral("traywindow"), - QByteArrayLiteral("gettimestamp"), QByteArrayLiteral("x11screen") + QByteArrayLiteral("gettimestamp"), QByteArrayLiteral("x11screen"), + QByteArrayLiteral("rootwindow") }; const QByteArray *end = names + sizeof(names) / sizeof(names[0]); const QByteArray *result = std::find(names, end, key); @@ -142,6 +143,9 @@ void *QXcbNativeInterface::nativeResourceForIntegration(const QByteArray &resour case X11Screen: result = x11Screen(); break; + case RootWindow: + result = rootWindow(); + break; default: break; } @@ -264,6 +268,15 @@ void *QXcbNativeInterface::x11Screen() return 0; } +void *QXcbNativeInterface::rootWindow() +{ + QXcbIntegration *integration = static_cast(QGuiApplicationPrivate::platformIntegration()); + QXcbConnection *defaultConnection = integration->defaultConnection(); + if (defaultConnection) + return reinterpret_cast(defaultConnection->rootWindow()); + return 0; +} + void QXcbNativeInterface::setAppTime(QScreen* screen, xcb_timestamp_t time) { static_cast(screen->handle())->connection()->setTime(time); diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.h b/src/plugins/platforms/xcb/qxcbnativeinterface.h index 9c4fa44d3b..fb1a46014c 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.h +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.h @@ -70,7 +70,8 @@ public: StartupId, TrayWindow, GetTimestamp, - X11Screen + X11Screen, + RootWindow }; QXcbNativeInterface(); @@ -94,6 +95,7 @@ public: void *getTimestamp(const QXcbScreen *screen); void *startupId(); void *x11Screen(); + void *rootWindow(); static void setAppTime(QScreen *screen, xcb_timestamp_t time); static void setAppUserTime(QScreen *screen, xcb_timestamp_t time); static void *eglContextForContext(QOpenGLContext *context); -- cgit v1.2.3