From 0cb44e2cfb11033cdb7e3b73a25f1ec394b08d6e Mon Sep 17 00:00:00 2001 From: Arnaud Bienner Date: Fri, 19 Oct 2018 14:50:59 +0200 Subject: Fix stylesheet example for QLineEdit:read-only code example Change-Id: I987a4129968e9af74e21a2d855c4576a9caada73 Reviewed-by: Friedemann Kleint --- src/widgets/doc/snippets/code/doc_src_stylesheet.qdoc | 1 + 1 file changed, 1 insertion(+) 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] -- cgit v1.2.3-59-g8ed1b From 72bedd49bfb02ba7c7abf2a1a4c6cd165ebcd447 Mon Sep 17 00:00:00 2001 From: Michael Brüning Date: Tue, 16 Oct 2018 18:17:56 +0200 Subject: [cocoa] Disable offline renderers for dual AMD FirePro GPU MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The AMD FirePro dual gpus on the Mac Pro have a problem with offline renderers in Chromium. Therefore, Chromium and thus Qt WebEngine disable this option via the pixel format attributes. The Qt Cocoa plugin on the other hand enables it in the recent versions, causing context creation in Qt WebEngine to fail when run on a Mac Pro with dual AMD FirePro gpus due to incompatible context options. This patch uses the environment variable QT_MAC_PRO_WEBENGINE_WORKAROUND which is set by Qt WebEngine upon application startup if the application is running on a late 2013 Mac Pro. It should typically not be set from anywhere else. [ChangeLog] Offline renderers will be disabled when the application is using Qt WebEngine and running on one of the late 2013 Mac Pro models. Fixes: QTBUG-70062 Change-Id: I0b0831efb6f4073ebd37672040aaed6370853fc0 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoaglcontext.mm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index 7ffe0003d3..76f8a7bb02 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -456,7 +456,13 @@ NSOpenGLPixelFormat *QCocoaGLContext::createNSOpenGLPixelFormat(const QSurfaceFo if (format.stereo()) attrs << NSOpenGLPFAStereo; - 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; + } QByteArray useLayer = qgetenv("QT_MAC_WANTS_LAYER"); if (!useLayer.isEmpty() && useLayer.toInt() > 0) { -- cgit v1.2.3-59-g8ed1b From 509d566ec0f257f7f1a723096b57a718d43d5002 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 18 Oct 2018 22:13:29 +0200 Subject: Don't block mouse events if the window is a Tooltip type If a tooltip was shown on an application modal dialog then it would end up blocking mouse events to the dialog while the tooltip was visible. Since tooltips are special in this case, they should not cause mouse events to be blocked. Fixes: QTBUG-65599 Change-Id: Ibf1729ca4942f5854e4f9687c5586382e23c1c31 Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qguiapplication.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 193712a7a7..06d1fcae53 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -792,7 +792,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); } -- cgit v1.2.3-59-g8ed1b From 38afa46c47f4401cd5fe8ce6eb93978d5287cfbc Mon Sep 17 00:00:00 2001 From: Tor Arne Vestbø Date: Fri, 19 Oct 2018 14:35:40 +0200 Subject: macOS: Only detect changes to the SDK version within the same developer dir We want to inform the user when they have upgraded their Xcode version and hence have a new SDK version, which requires a complete rebuild. Explicit changes to the Xcode selection (be it via xcode-select or $DEVELOPER_DIR) do not affect the existing build directory, so we must record the Xcode selection inside the build to avoid false triggering. Change-Id: I7d13da1232226712a4951e8a360cf4b634c6fa2f Reviewed-by: Oswald Buddenhagen --- mkspecs/features/mac/default_post.prf | 2 +- mkspecs/features/mac/sdk.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index 353fda41e6..6ea667c1a5 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).) -- cgit v1.2.3-59-g8ed1b From d2e0e416d4444ccf3c208d6770e32ff0fb04b543 Mon Sep 17 00:00:00 2001 From: Kirill Burtsev Date: Tue, 23 Oct 2018 18:04:18 +0200 Subject: Fix leaking QTabletEventPrivate instance Fixes: QTBUG-52279 Change-Id: I4f40fc9d3ce938b4c821f10cacd21e6f652a2227 Reviewed-by: Shawn Rutledge --- src/gui/kernel/qevent.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 4207697c01..94fc342e2a 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -2494,6 +2494,7 @@ QTabletEvent::QTabletEvent(Type type, const QPointF &pos, const QPointF &globalP */ QTabletEvent::~QTabletEvent() { + delete static_cast(mExtra); } /*! -- cgit v1.2.3-59-g8ed1b From d4e937a6280f34bc1cce8c8cea3806a741312fbc Mon Sep 17 00:00:00 2001 From: Błażej Szczygieł Date: Tue, 25 Sep 2018 18:45:10 +0200 Subject: xcb: Don't get initial screen rotation "xcb_randr_get_screen_info" can be slow and in some configurations can cause short mouse cursor freezes (which will happen on Qt application startup). Initial screen rotation was used only to not handle possible redundant screen change event. Fixes: QTBUG-70760 Change-Id: I9f01325a045d2c82c4dd2fce91a18a34e54a4bcd Reviewed-by: Gatis Paeglis --- src/plugins/platforms/xcb/qxcbscreen.cpp | 7 ------- src/plugins/platforms/xcb/qxcbscreen.h | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index 7f2793b2b7..a696e2a311 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -118,13 +118,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 6438669e7a..792aca4b06 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.h +++ b/src/plugins/platforms/xcb/qxcbscreen.h @@ -220,7 +220,7 @@ private: xcb_randr_crtc_t m_crtc; xcb_randr_mode_t m_mode = XCB_NONE; bool m_primary = false; - uint8_t m_rotation = XCB_RANDR_ROTATION_ROTATE_0; + uint8_t m_rotation = 0; QString m_outputName; QSizeF m_outputSizeMillimeters; -- cgit v1.2.3-59-g8ed1b From 3b8075de3b3c842311c157476a85d2cf9ddff403 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 25 Oct 2018 16:32:13 -0700 Subject: Fix deleting of QSharedPointer internals in case QPointer loses the race MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QPointer uses QWeakPointer / QSharedPointer internals in QObject and has the code to make sure two threads won't stomp on each other if both try to create a QPointer for the same QObject at the same time. The threading code was fine, but had a mistake in the clean up code for the loser thread: the QtSharedPointer::ExternalRefCountData destructor has a Q_ASSERT for the state of the reference counts. So we need to set the state correctly before calling the destructor. But we don't want to do it in case the Q_ASSERT compiled to nothing. So we use a hack that violates the Second Rule of Q_ASSERTs: don't do something with side-effects. This way, we can insert code that will only be compiled if Q_ASSERTs do something, without having to duplicate the preprocessor conditions from qglobal.h. Fixes: QTBUG-71412 Change-Id: I1bd327aeaf73421a8ec5fffd1560fdfc8b73b70c Reviewed-by: Romain Pokrzywka Reviewed-by: Jędrzej Nowacki --- src/corelib/tools/qsharedpointer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index 2d5fd2a00e..65616e2abb 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -1466,6 +1466,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(); -- cgit v1.2.3-59-g8ed1b From 1b9af84c1bb66770f607e157991375f7cb7ae0fb Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Tue, 23 Oct 2018 11:41:19 +0200 Subject: Don't create an offscreen surface when not on the GUI thread When we try to gracefully destroy a QOpenGLVertexArrayObject it is not possible to create an QOffscreenSurface from a thread that is not the GUI thread. In this case we just need to bail out instead. The side effect that was seen previously was that there would be a warning and a deadlock on Windows when closing QQuickWindows that contained a QQuickPaintedItem backed by a FrameBufferObject render target (which would be using the OpenGL paint engine) when using the threaded render loop. Task-number: QTBUG-70148 Change-Id: I4a20d74d9af850bb90d243212ad9f65c3fc9e616 Reviewed-by: Laszlo Agocs --- src/gui/opengl/qopenglvertexarrayobject.cpp | 33 ++++++++++++++++++----------- 1 file changed, 21 insertions(+), 12 deletions(-) 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 +#include #include #include +#include #include #include @@ -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: -- cgit v1.2.3-59-g8ed1b From c9d18d4a9c9d1243a267316e2a702f9ba69de2fd Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Wed, 31 Oct 2018 10:03:09 +0200 Subject: eglfs_kms: initialize m_deviceListener If QT_QPA_EGLFS_HIDECURSOR was enabled, m_deviceListener was never initialized, which caused segfault in the destructor. Task-number: QTBUG-71507 Change-Id: Id8b17f5312073249cd12995317213fd746753521 Reviewed-by: Laszlo Agocs --- .../platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp | 1 + 1 file changed, 1 insertion(+) 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()) { -- cgit v1.2.3-59-g8ed1b