diff options
-rw-r--r-- | mkspecs/features/mac/default_post.prf | 2 | ||||
-rw-r--r-- | mkspecs/features/mac/sdk.mk | 2 | ||||
-rw-r--r-- | src/corelib/tools/qsharedpointer.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qevent.cpp | 1 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 3 | ||||
-rw-r--r-- | src/gui/opengl/qopenglvertexarrayobject.cpp | 33 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaglcontext.mm | 9 | ||||
-rw-r--r-- | src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp | 1 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbscreen.cpp | 7 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/qxcbscreen.h | 2 | ||||
-rw-r--r-- | src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc | 1 |
11 files changed, 39 insertions, 25 deletions
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index 5d3ab7ed6e..99f68b78f5 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -3,7 +3,7 @@ load(default_post) contains(TEMPLATE, .*app) { !macx-xcode { # Detect changes to the platform SDK - QMAKE_EXTRA_VARIABLES += QMAKE_MAC_SDK QMAKE_MAC_SDK_VERSION + QMAKE_EXTRA_VARIABLES += QMAKE_MAC_SDK QMAKE_MAC_SDK_VERSION QMAKE_XCODE_DEVELOPER_PATH QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/sdk.mk) } diff --git a/mkspecs/features/mac/sdk.mk b/mkspecs/features/mac/sdk.mk index a7c8268da5..c0266f2139 100644 --- a/mkspecs/features/mac/sdk.mk +++ b/mkspecs/features/mac/sdk.mk @@ -1,4 +1,4 @@ -CURRENT_MAC_SDK_VERSION := $(shell /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version) +CURRENT_MAC_SDK_VERSION := $(shell DEVELOPER_DIR=$(EXPORT_QMAKE_XCODE_DEVELOPER_PATH) /usr/bin/xcrun --sdk $(EXPORT_QMAKE_MAC_SDK) -show-sdk-version) ifneq ($(CURRENT_MAC_SDK_VERSION),$(EXPORT_QMAKE_MAC_SDK_VERSION)) $(info The platform SDK has been changed from version $(EXPORT_QMAKE_MAC_SDK_VERSION) to version $(CURRENT_MAC_SDK_VERSION).) diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index e58d3ab6bc..622b03f42d 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -1384,6 +1384,9 @@ QtSharedPointer::ExternalRefCountData *QtSharedPointer::ExternalRefCountData::ge x->strongref.store(-1); x->weakref.store(2); // the QWeakPointer that called us plus the QObject itself if (!d->sharedRefcount.testAndSetRelease(0, x)) { + // ~ExternalRefCountData has a Q_ASSERT, so we use this trick to + // only execute this if Q_ASSERTs are enabled + Q_ASSERT((x->weakref.store(0), true)); delete x; x = d->sharedRefcount.loadAcquire(); x->weakref.ref(); diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 0e35fb7d7b..53d1ac1fc0 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -2533,6 +2533,7 @@ QTabletEvent::QTabletEvent(Type type, const QPointF &pos, const QPointF &globalP */ QTabletEvent::~QTabletEvent() { + delete static_cast<QTabletEventPrivate *>(mExtra); } /*! diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index e5657000cf..f4e2dda05a 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -803,7 +803,8 @@ static void updateBlockedStatusRecursion(QWindow *window, bool shouldBeBlocked) void QGuiApplicationPrivate::updateBlockedStatus(QWindow *window) { bool shouldBeBlocked = false; - if (!QWindowPrivate::get(window)->isPopup() && !self->modalWindowList.isEmpty()) + const bool popupType = (window->type() == Qt::ToolTip) || (window->type() == Qt::Popup); + if (!popupType && !self->modalWindowList.isEmpty()) shouldBeBlocked = self->isWindowBlocked(window); updateBlockedStatusRecursion(window, shouldBeBlocked); } diff --git a/src/gui/opengl/qopenglvertexarrayobject.cpp b/src/gui/opengl/qopenglvertexarrayobject.cpp index 0262538250..f0837aff96 100644 --- a/src/gui/opengl/qopenglvertexarrayobject.cpp +++ b/src/gui/opengl/qopenglvertexarrayobject.cpp @@ -40,8 +40,10 @@ #include "qopenglvertexarrayobject.h" #include <QtCore/private/qobject_p.h> +#include <QtCore/qthread.h> #include <QtGui/qopenglcontext.h> #include <QtGui/qoffscreensurface.h> +#include <QtGui/qguiapplication.h> #include <QtGui/qopenglfunctions_3_0.h> #include <QtGui/qopenglfunctions_3_2_core.h> @@ -204,18 +206,25 @@ void QOpenGLVertexArrayObjectPrivate::destroy() if (context && context != ctx) { oldContext = ctx; oldContextSurface = ctx ? ctx->surface() : 0; - // Cannot just make the current surface current again with another context. - // The format may be incompatible and some platforms (iOS) may impose - // restrictions on using a window with different contexts. Create an - // offscreen surface (a pbuffer or a hidden window) instead to be safe. - offscreenSurface.reset(new QOffscreenSurface); - offscreenSurface->setFormat(context->format()); - offscreenSurface->create(); - if (context->makeCurrent(offscreenSurface.data())) { - ctx = context; - } else { - qWarning("QOpenGLVertexArrayObject::destroy() failed to make VAO's context current"); + // Before going through the effort of creating an offscreen surface + // check that we are on the GUI thread because otherwise many platforms + // will not able to create that offscreen surface. + if (QThread::currentThread() != qGuiApp->thread()) { ctx = 0; + } else { + // Cannot just make the current surface current again with another context. + // The format may be incompatible and some platforms (iOS) may impose + // restrictions on using a window with different contexts. Create an + // offscreen surface (a pbuffer or a hidden window) instead to be safe. + offscreenSurface.reset(new QOffscreenSurface); + offscreenSurface->setFormat(context->format()); + offscreenSurface->create(); + if (context->makeCurrent(offscreenSurface.data())) { + ctx = context; + } else { + qWarning("QOpenGLVertexArrayObject::destroy() failed to make VAO's context current"); + ctx = 0; + } } } @@ -224,7 +233,7 @@ void QOpenGLVertexArrayObjectPrivate::destroy() context = 0; } - if (vao) { + if (vao && ctx) { switch (vaoFuncsType) { #ifndef QT_OPENGL_ES_2 case Core_3_2: diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index 1cd77a22e4..93d95b38ea 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -216,8 +216,13 @@ NSOpenGLPixelFormat *QCocoaGLContext::pixelFormatForSurfaceFormat(const QSurface << NSOpenGLPFASamples << NSOpenGLPixelFormatAttribute(format.samples()); } - // Allow rendering on GPUs without a connected display - attrs << NSOpenGLPFAAllowOfflineRenderers; + //Workaround for problems with Chromium and offline renderers on the lat 2013 MacPros. + //FIXME: Think if this could be solved via QSurfaceFormat in the future. + static bool offlineRenderersAllowed = qEnvironmentVariableIsEmpty("QT_MAC_PRO_WEBENGINE_WORKAROUND"); + if (offlineRenderersAllowed) { + // Allow rendering on GPUs without a connected display + attrs << NSOpenGLPFAAllowOfflineRenderers; + } // FIXME: Pull this information out of the NSView QByteArray useLayer = qgetenv("QT_MAC_WANTS_LAYER"); diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp index 9bd7fee1fb..4d0cf0c47e 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp @@ -71,6 +71,7 @@ QEglFSKmsGbmCursor::QEglFSKmsGbmCursor(QEglFSKmsGbmScreen *screen) , m_bo(nullptr) , m_cursorImage(0, 0, 0, 0, 0, 0) , m_state(CursorPendingVisible) + , m_deviceListener(nullptr) { QByteArray hideCursorVal = qgetenv("QT_QPA_EGLFS_HIDECURSOR"); if (!hideCursorVal.isEmpty() && hideCursorVal.toInt()) { diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index 35e90e4206..57dbdc9bec 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -112,13 +112,6 @@ QXcbVirtualDesktop::QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t xcb_depth_next(&depth_iterator); } - - if (connection->hasXRandr()) { - xcb_connection_t *conn = connection->xcb_connection(); - auto screen_info = Q_XCB_REPLY(xcb_randr_get_screen_info, conn, screen->root); - if (screen_info) - m_rotation = screen_info->rotation; - } } QXcbVirtualDesktop::~QXcbVirtualDesktop() diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h index 4404a04f49..7f22a8e4db 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.h +++ b/src/plugins/platforms/xcb/qxcbscreen.h @@ -134,7 +134,7 @@ private: QString m_windowManagerName; QMap<xcb_visualid_t, xcb_visualtype_t> m_visuals; QMap<xcb_visualid_t, quint8> m_visualDepths; - uint16_t m_rotation = XCB_RANDR_ROTATION_ROTATE_0; + uint16_t m_rotation = 0; }; class Q_XCB_EXPORT QXcbScreen : public QXcbObject, public QPlatformScreen diff --git a/src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc b/src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc index bf727dd380..9af04f6b4c 100644 --- a/src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc +++ b/src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc @@ -954,6 +954,7 @@ QLineEdit[echoMode="2"] { //! [119] QLineEdit:read-only { background: lightblue; +} //! [119] |