summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-08-16 07:58:32 +0200
committerLiang Qi <liang.qi@qt.io>2016-08-16 07:58:32 +0200
commit17198e03ab36e5f579a1477b09cc3e601975eb5f (patch)
tree61ba826e9edd53469abdc1e1f58b1223d0336c56 /src/platformsupport
parenta5e89005445ac8ca18ac046eaf55fe2230e47cd6 (diff)
parent2e2b32a9ab459f6618d02e4b454c75a787172def (diff)
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/global/qglobal.cpp src/corelib/tools/qstring.cpp src/network/socket/qabstractsocket.cpp src/network/socket/qnativesocketengine_unix.cpp src/plugins/platforms/eglfs/api/qeglfsglobal.h Change-Id: Id5dfdbd30fa996f9b4b66a0b030b7d3b8c0ef288
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/eglconvenience/eglconvenience.pri7
-rw-r--r--src/platformsupport/eglconvenience/qeglconvenience_p.h2
-rw-r--r--src/platformsupport/eglconvenience/qeglpbuffer_p.h1
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformcontext_p.h2
-rw-r--r--src/platformsupport/eglconvenience/qeglstreamconvenience_p.h3
-rw-r--r--src/platformsupport/eglconvenience/qt_egl_p.h117
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp8
-rw-r--r--src/platformsupport/linuxaccessibility/atspiadaptor.cpp3
8 files changed, 131 insertions, 12 deletions
diff --git a/src/platformsupport/eglconvenience/eglconvenience.pri b/src/platformsupport/eglconvenience/eglconvenience.pri
index fe6d0eb748..1cacaf4a4c 100644
--- a/src/platformsupport/eglconvenience/eglconvenience.pri
+++ b/src/platformsupport/eglconvenience/eglconvenience.pri
@@ -1,7 +1,8 @@
contains(QT_CONFIG,egl) {
HEADERS += \
$$PWD/qeglconvenience_p.h \
- $$PWD/qeglstreamconvenience_p.h
+ $$PWD/qeglstreamconvenience_p.h \
+ $$PWD/qt_egl_p.h
SOURCES += \
$$PWD/qeglconvenience.cpp \
@@ -15,8 +16,8 @@ contains(QT_CONFIG,egl) {
$$PWD/qeglpbuffer.cpp
}
- # Avoid X11 header collision
- DEFINES += MESA_EGL_NO_X11_HEADERS
+ # Avoid X11 header collision, use generic EGL native types
+ DEFINES += QT_EGL_NO_X11
contains(QT_CONFIG,xlib) {
HEADERS += \
diff --git a/src/platformsupport/eglconvenience/qeglconvenience_p.h b/src/platformsupport/eglconvenience/qeglconvenience_p.h
index ec5c1e403a..fdd21b8f19 100644
--- a/src/platformsupport/eglconvenience/qeglconvenience_p.h
+++ b/src/platformsupport/eglconvenience/qeglconvenience_p.h
@@ -54,7 +54,7 @@
#include <QtGui/QSurfaceFormat>
#include <QtCore/QVector>
#include <QtCore/QSizeF>
-#include <EGL/egl.h>
+#include <QtPlatformSupport/private/qt_egl_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/eglconvenience/qeglpbuffer_p.h b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
index 19a29d5dd8..4f9ea9d5f3 100644
--- a/src/platformsupport/eglconvenience/qeglpbuffer_p.h
+++ b/src/platformsupport/eglconvenience/qeglpbuffer_p.h
@@ -53,7 +53,6 @@
#include <qpa/qplatformoffscreensurface.h>
#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
-#include <EGL/egl.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
index e772f5df89..f6b2b876f7 100644
--- a/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
+++ b/src/platformsupport/eglconvenience/qeglplatformcontext_p.h
@@ -55,7 +55,7 @@
#include <qpa/qplatformwindow.h>
#include <qpa/qplatformopenglcontext.h>
#include <QtCore/QVariant>
-#include <EGL/egl.h>
+#include <QtPlatformSupport/private/qt_egl_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h b/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h
index c8a8096816..f535afbc55 100644
--- a/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h
+++ b/src/platformsupport/eglconvenience/qeglstreamconvenience_p.h
@@ -52,8 +52,7 @@
//
#include <qglobal.h>
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
+#include <QtPlatformSupport/private/qt_egl_p.h>
// This provides runtime EGLDevice/Output/Stream support even when eglext.h in
// the sysroot is not up-to-date.
diff --git a/src/platformsupport/eglconvenience/qt_egl_p.h b/src/platformsupport/eglconvenience/qt_egl_p.h
new file mode 100644
index 0000000000..615ee4b80a
--- /dev/null
+++ b/src/platformsupport/eglconvenience/qt_egl_p.h
@@ -0,0 +1,117 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtGui module 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QT_EGL_P_H
+#define QT_EGL_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#ifdef QT_EGL_NO_X11
+# define MESA_EGL_NO_X11_HEADERS // MESA
+# define WIN_INTERFACE_CUSTOM // NV
+#endif // QT_EGL_NO_X11
+
+#ifdef QT_EGL_WAYLAND
+# define WAYLAND // NV
+#endif // QT_EGL_WAYLAND
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+#include <stdint.h>
+
+QT_BEGIN_NAMESPACE
+
+namespace QtInternal {
+
+template <class FromType, class ToType>
+struct QtEglConverter
+{
+ static inline ToType convert(FromType v)
+ { return v; }
+};
+
+template <>
+struct QtEglConverter<uint32_t, uintptr_t>
+{
+ static inline uintptr_t convert(uint32_t v)
+ { return v; }
+};
+
+#if Q_PROCESSOR_WORDSIZE > 4
+template <>
+struct QtEglConverter<uintptr_t, uint32_t>
+{
+ static inline uint32_t convert(uintptr_t v)
+ { return uint32_t(v); }
+};
+#endif
+
+template <>
+struct QtEglConverter<uint32_t, void *>
+{
+ static inline void *convert(uint32_t v)
+ { return reinterpret_cast<void *>(uintptr_t(v)); }
+};
+
+template <>
+struct QtEglConverter<void *, uint32_t>
+{
+ static inline uint32_t convert(void *v)
+ { return uintptr_t(v); }
+};
+
+} // QtInternal
+
+template <class ToType, class FromType>
+static inline ToType qt_egl_cast(FromType from)
+{ return QtInternal::QtEglConverter<FromType, ToType>::convert(from); }
+
+QT_END_NAMESPACE
+
+#endif // QT_EGL_P_H
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
index 5f9455559d..f9e81e840f 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
@@ -415,9 +415,13 @@ void QEvdevTouchScreenHandler::unregisterTouchDevice()
if (!m_device)
return;
- QWindowSystemInterface::unregisterTouchDevice(m_device);
+ // At app exit the cleanup may have already been done, avoid
+ // double delete by checking the list first.
+ if (QWindowSystemInterface::isTouchDeviceRegistered(m_device)) {
+ QWindowSystemInterface::unregisterTouchDevice(m_device);
+ delete m_device;
+ }
- delete m_device;
m_device = Q_NULLPTR;
}
diff --git a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
index 24c646c40b..f6c126a771 100644
--- a/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
+++ b/src/platformsupport/linuxaccessibility/atspiadaptor.cpp
@@ -2079,7 +2079,6 @@ QVariantList AtSpiAdaptor::getAttributeValue(QAccessibleInterface *interface, in
QSpiAttributeSet map;
int startOffset;
int endOffset;
- bool defined;
joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset);
attributes = joined.split (QLatin1Char(';'), QString::SkipEmptyParts, Qt::CaseSensitive);
@@ -2091,7 +2090,7 @@ QVariantList AtSpiAdaptor::getAttributeValue(QAccessibleInterface *interface, in
map[attribute.name] = attribute.value;
}
mapped = map[attributeName];
- defined = mapped.isEmpty();
+ const bool defined = !mapped.isEmpty();
QVariantList list;
list << mapped << startOffset << endOffset << defined;
return list;