From 811465032b226d41fc5dd6971bed590b8af3a0a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 9 Aug 2019 12:25:05 +0200 Subject: =?UTF-8?q?macOS:=20Don=E2=80=99t=20show=20hidden=20windows=20whil?= =?UTF-8?q?e=20z-ordering?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calling [NSWindow orderBack] will make the window visible again, and will e.g. bring back closed menus on application modality changes. Fixes: QTBUG-77281 Change-Id: I2f89b852ea9f8ab34c709cec96d93fe305984fb9 Reviewed-by: Timur Pocheptsov Reviewed-by: Tor Arne Vestbø (cherry picked from commit 3729695cc9d550e831567772441ad55bd767ab1a) --- src/plugins/platforms/cocoa/qcocoawindowmanager.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoawindowmanager.mm b/src/plugins/platforms/cocoa/qcocoawindowmanager.mm index 879bfaa546..9c45d8c7fc 100644 --- a/src/plugins/platforms/cocoa/qcocoawindowmanager.mm +++ b/src/plugins/platforms/cocoa/qcocoawindowmanager.mm @@ -92,7 +92,8 @@ void QCocoaWindowManager::modalSessionChanged() if (NSApp.modalWindow) { // Lower window to that of the modal windows, but no less nativeWindow.level = NSModalPanelWindowLevel; - [nativeWindow orderBack:nil]; + if ([nativeWindow isVisible]) + [nativeWindow orderBack:nil]; } else { // Restore window's natural window level, whatever that was nativeWindow.level = naturalWindowLevel; -- cgit v1.2.3 From a9b9a881344239781e5894f2dd3d0af90ffbb4ba Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 6 Aug 2019 13:15:35 +0200 Subject: eglfs: Fix raster windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also sanitize the initial WebAssembly hack. Both eglfs and wasm lack the concept of true raster windows. A QWindow with RasterSurface is rendered with OpenGL no matter what. The two platforms took two different approaches to work around the rest of the machinery: - wasm disabled the QOpenGLContext warning for non-OpenGL QWindows, - eglfs forced the QWindow surfaceType to OpenGLSurface whenever it was originally set to RasterSurface. Now, the latter breaks since c4e9eabc309a275efc222f4127f31ba4677259b7, leaving all raster window applications failing on eglfs, because flush in the backingstore is now checking the surface type and disallows OpenGLSurface windows. (just like how QOpenGLContext disallows RasterSurface windows) To solve all this correctly, introduce a new platform capability, OpenGLOnRasterSurface, and remove the special handling in the platform plugins. Change-Id: I7785dfb1c955577bbdccdc14ebaaac5babdec57c Fixes: QTBUG-77100 Reviewed-by: Tor Arne Vestbø (cherry picked from commit 53a6f7b7836ef5084106ed63f6745c20d663affa) Reviewed-by: Jukka Jokiniva --- src/gui/kernel/qopenglcontext.cpp | 3 --- src/gui/kernel/qplatformintegration.cpp | 3 +++ src/gui/kernel/qplatformintegration.h | 3 ++- src/gui/kernel/qsurface.cpp | 6 ++++++ src/plugins/platforms/eglfs/api/qeglfsintegration.cpp | 1 + src/plugins/platforms/eglfs/api/qeglfswindow.cpp | 9 ++------- src/plugins/platforms/eglfs/api/qeglfswindow_p.h | 1 - src/plugins/platforms/wasm/qwasmintegration.cpp | 1 + 8 files changed, 15 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index b677afc526..3d9f1309c9 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -976,11 +976,8 @@ bool QOpenGLContext::makeCurrent(QSurface *surface) if (!surface->surfaceHandle()) return false; if (!surface->supportsOpenGL()) { -#ifndef Q_OS_WASM // ### work around the WASM platform plugin using QOpenGLContext with raster surfaces. - // see QTBUG-70076 qWarning() << "QOpenGLContext::makeCurrent() called with non-opengl surface" << surface; return false; -#endif } if (!d->platformGLContext->makeCurrent(surface->surfaceHandle())) diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index 490cfc6178..b3d3db0751 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -244,6 +244,9 @@ QPlatformServices *QPlatformIntegration::services() const \value TopStackedNativeChildWindows The platform supports native child windows via QWindowContainer without having to punch a transparent hole in the backingstore. (since 5.10) + + \value OpenGLOnRasterSurface The platform supports making a QOpenGLContext current + in combination with a QWindow of type RasterSurface. */ /*! diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h index 389b35dbc0..a3594042ce 100644 --- a/src/gui/kernel/qplatformintegration.h +++ b/src/gui/kernel/qplatformintegration.h @@ -105,7 +105,8 @@ public: AllGLFunctionsQueryable, ApplicationIcon, SwitchableWidgetComposition, - TopStackedNativeChildWindows + TopStackedNativeChildWindows, + OpenGLOnRasterSurface }; virtual ~QPlatformIntegration() { } diff --git a/src/gui/kernel/qsurface.cpp b/src/gui/kernel/qsurface.cpp index 415e64b39c..709f28d431 100644 --- a/src/gui/kernel/qsurface.cpp +++ b/src/gui/kernel/qsurface.cpp @@ -39,6 +39,8 @@ #include "qsurface.h" #include "qopenglcontext.h" +#include +#include QT_BEGIN_NAMESPACE @@ -103,6 +105,10 @@ QT_BEGIN_NAMESPACE bool QSurface::supportsOpenGL() const { SurfaceType type = surfaceType(); + if (type == RasterSurface) { + QPlatformIntegration *integ = QGuiApplicationPrivate::instance()->platformIntegration(); + return integ->hasCapability(QPlatformIntegration::OpenGLOnRasterSurface); + } return type == OpenGLSurface || type == RasterGLSurface; } diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp index c8a1ddf9b9..674f579b4f 100644 --- a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp @@ -265,6 +265,7 @@ bool QEglFSIntegration::hasCapability(QPlatformIntegration::Capability cap) cons case RasterGLSurface: return false; #endif case WindowManagement: return false; + case OpenGLOnRasterSurface: return true; default: return QPlatformIntegration::hasCapability(cap); } } diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp index c1d5af47aa..1fed182882 100644 --- a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp @@ -64,7 +64,6 @@ QEglFSWindow::QEglFSWindow(QWindow *w) m_backingStore(0), m_rasterCompositingContext(0), #endif - m_raster(false), m_winId(0), m_surface(EGL_NO_SURFACE), m_window(0), @@ -94,11 +93,6 @@ void QEglFSWindow::create() m_winId = newWId(); - // Save the original surface type before changing to OpenGLSurface. - m_raster = (window()->surfaceType() == QSurface::RasterSurface); - if (m_raster) // change to OpenGL, but not for RasterGLSurface - window()->setSurfaceType(QSurface::OpenGLSurface); - if (window()->type() == Qt::Desktop) { QRect fullscreenRect(QPoint(), screen()->availableGeometry().size()); QWindowSystemInterface::handleGeometryChange(window(), fullscreenRect); @@ -329,7 +323,8 @@ QEglFSScreen *QEglFSWindow::screen() const bool QEglFSWindow::isRaster() const { - return m_raster || window()->surfaceType() == QSurface::RasterGLSurface; + const QWindow::SurfaceType type = window()->surfaceType(); + return type == QSurface::RasterSurface || type == QSurface::RasterGLSurface; } #ifndef QT_NO_OPENGL diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow_p.h b/src/plugins/platforms/eglfs/api/qeglfswindow_p.h index b0091e2a62..be2a0630d3 100644 --- a/src/plugins/platforms/eglfs/api/qeglfswindow_p.h +++ b/src/plugins/platforms/eglfs/api/qeglfswindow_p.h @@ -118,7 +118,6 @@ protected: QOpenGLCompositorBackingStore *m_backingStore; QOpenGLContext *m_rasterCompositingContext; #endif - bool m_raster; WId m_winId; EGLSurface m_surface; diff --git a/src/plugins/platforms/wasm/qwasmintegration.cpp b/src/plugins/platforms/wasm/qwasmintegration.cpp index 116612c286..1e9f68027c 100644 --- a/src/plugins/platforms/wasm/qwasmintegration.cpp +++ b/src/plugins/platforms/wasm/qwasmintegration.cpp @@ -168,6 +168,7 @@ bool QWasmIntegration::hasCapability(QPlatformIntegration::Capability cap) const case RasterGLSurface: return false; // to enable this you need to fix qopenglwidget and quickwidget for wasm case MultipleWindows: return true; case WindowManagement: return true; + case OpenGLOnRasterSurface: return true; default: return QPlatformIntegration::hasCapability(cap); } } -- cgit v1.2.3 From 7d0fff91ddadd03ff900b6d9a046a92ce6bf5a63 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 20 Aug 2019 10:30:44 +0200 Subject: Revert "Disable debug plugin check for MinGW" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch caused an error when loading applications built in debug mode with MinGW and thus has to be reverted. This reverts commit bba44746f9f2cfca785a309deb056033ae0bea6e. Fixes: QTBUG-77431 Change-Id: I3134878a742b304d10176cc8b0ed5ce06d4de53f Reviewed-by: Jani Heikkinen Reviewed-by: Jörg Bornemann --- src/corelib/plugin/qlibrary.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 3aadd1a73b..0e32776c71 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE # define QLIBRARY_AS_DEBUG true #endif -#if defined(Q_OS_UNIX) || defined(Q_CC_MINGW) +#if defined(Q_OS_UNIX) // We don't use separate debug and release libs on UNIX, so we want // to allow loading plugins, regardless of how they were built. # define QT_NO_DEBUG_PLUGIN_CHECK -- cgit v1.2.3 From af6ac444c97ed2dc234f93fe457440c9da5482ea Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Tue, 27 Aug 2019 14:44:48 +0200 Subject: Fix crash when text contains too many directional chars In case a text to be layouted contains more than 128 directional characters it causes the application to crash The function initScriptAnalysisAndIsolatePairs() collects information of RTL/LTR chaaracters into vector "isolatePairs". The size of the vector is capped to 128. Later the function generateDirectionalRuns() iterates the text again and tries to access items from the previously capped vector above the upper bound. Task-number: QTBUG-77819 Change-Id: Ibb7bf12c12b1db22f43ff46236518da3fdeed26a Reviewed-by: Simon Hausmann (cherry picked from commit 1232205e32464d90e871f39eb1e14fcf9b78a163) Reviewed-by: Jukka Jokiniva Reviewed-by: Volker Hilsheimer --- src/gui/text/qtextengine.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 2da13289bf..a7834587b1 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -399,6 +399,7 @@ struct QBidiAlgorithm { analysis[i].bidiDirection = (level & 1) ? QChar::DirR : QChar::DirL; runHasContent = true; lastRunWithContent = -1; + ++isolatePairPosition; } int runBeforeIsolate = runs.size(); ushort newLevel = isRtl ? ((stack.top().level + 1) | 1) : ((stack.top().level + 2) & ~1); @@ -440,21 +441,19 @@ struct QBidiAlgorithm { doEmbed(true, true, false); break; case QChar::DirLRI: - Q_ASSERT(isolatePairs.at(isolatePairPosition).start == i); doEmbed(false, false, true); - ++isolatePairPosition; break; case QChar::DirRLI: - Q_ASSERT(isolatePairs.at(isolatePairPosition).start == i); doEmbed(true, false, true); - ++isolatePairPosition; break; case QChar::DirFSI: { - const auto &pair = isolatePairs.at(isolatePairPosition); - Q_ASSERT(pair.start == i); - bool isRtl = QStringView(text + pair.start + 1, pair.end - pair.start - 1).isRightToLeft(); + bool isRtl = false; + if (isolatePairPosition < isolatePairs.size()) { + const auto &pair = isolatePairs.at(isolatePairPosition); + Q_ASSERT(pair.start == i); + isRtl = QStringView(text + pair.start + 1, pair.end - pair.start - 1).isRightToLeft(); + } doEmbed(isRtl, false, true); - ++isolatePairPosition; break; } -- cgit v1.2.3