From 05ddae12d18a348afd942fd85a8d8773698da3a1 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 15 Aug 2013 10:45:51 +0200 Subject: [PATCH 1/3] Android: Fix orientation change on Android 4.3 In Android 4.3, we will get a new native window pointer for the same surface (the old surface has not been destroyed), whereas before we would get the same pointer, thus hitting the "sameNativeWindow" branch. This revealed some bugs in the surfaceChanged code path when the old surface had not been destroyed. This path is now taken both when there's no old surface (the app has been suspended in the mean time) and when the orientation changes. To handle the second case, we need to make sure: 1. We update the static pointer 2. We update the pointers in the platform windows 3. We don't add a second reference to the static data for windows 4. We schedule an update of the window size Task-number: QTBUG-32878 Change-Id: I47257615f9ba820315fc98d7a804e52223f430bf Reviewed-by: Christian Stromme Reviewed-by: Frederik Gladhorn --- .../platforms/android/src/androidjnimain.cpp | 36 ++++++++++--------- .../opengl/qandroidopenglplatformwindow.cpp | 21 +++++++++-- .../src/opengl/qandroidopenglplatformwindow.h | 2 ++ .../src/qandroidplatformintegration.cpp | 1 + 4 files changed, 41 insertions(+), 19 deletions(-) diff --git a/src/plugins/platforms/android/src/androidjnimain.cpp b/src/plugins/platforms/android/src/androidjnimain.cpp index 162a8aa977..74183b3107 100644 --- a/src/plugins/platforms/android/src/androidjnimain.cpp +++ b/src/plugins/platforms/android/src/androidjnimain.cpp @@ -555,33 +555,37 @@ static void setSurface(JNIEnv *env, jobject /*thiz*/, jobject jSurface) m_nativeWindow = nativeWindow; if (m_waitForWindow) m_waitForWindowSemaphore.release(); - if (m_androidPlatformIntegration && !sameNativeWindow) { - m_surfaceMutex.unlock(); - m_androidPlatformIntegration->surfaceChanged(); - } else if (m_androidPlatformIntegration && sameNativeWindow) { - QPlatformScreen *screen = m_androidPlatformIntegration->screen(); + + if (m_androidPlatformIntegration) { QSize size = QtAndroid::nativeWindowSize(); + QPlatformScreen *screen = m_androidPlatformIntegration->screen(); QRect geometry(QPoint(0, 0), size); QWindowSystemInterface::handleScreenAvailableGeometryChange(screen->screen(), geometry); QWindowSystemInterface::handleScreenGeometryChange(screen->screen(), geometry); - // Resize all top level windows, since they share the same surface - foreach (QWindow *w, QGuiApplication::topLevelWindows()) { - QAndroidOpenGLPlatformWindow *window = - static_cast(w->handle()); + if (!sameNativeWindow) { + m_surfaceMutex.unlock(); + m_androidPlatformIntegration->surfaceChanged(); + } else { + // Resize all top level windows, since they share the same surface + foreach (QWindow *w, QGuiApplication::topLevelWindows()) { + QAndroidOpenGLPlatformWindow *window = + static_cast(w->handle()); - if (window != 0) { - window->lock(); - window->scheduleResize(size); + if (window != 0) { + window->lock(); + window->scheduleResize(size); - QWindowSystemInterface::handleExposeEvent(window->window(), - QRegion(window->window()->geometry())); - window->unlock(); + QWindowSystemInterface::handleExposeEvent(window->window(), + QRegion(window->window()->geometry())); + window->unlock(); + } } + + m_surfaceMutex.unlock(); } - m_surfaceMutex.unlock(); } else { m_surfaceMutex.unlock(); } diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp index 5362906e0e..b1a2231ff5 100644 --- a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp +++ b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp @@ -85,9 +85,19 @@ void QAndroidOpenGLPlatformWindow::invalidateSurface() } } +void QAndroidOpenGLPlatformWindow::updateStaticNativeWindow() +{ + QWriteLocker locker(&m_staticSurfaceLock); + m_staticNativeWindow = QtAndroid::nativeWindow(false); +} + void QAndroidOpenGLPlatformWindow::resetSurface() { - m_referenceCount.ref(); + // Only add a reference if we're not already holding one, otherwise we're just updating + // the native window pointer + if (m_window == 0) + m_referenceCount.ref(); + if (m_staticSurface == 0) { QWriteLocker locker(&m_staticSurfaceLock); QEglFSWindow::resetSurface(); @@ -95,12 +105,17 @@ void QAndroidOpenGLPlatformWindow::resetSurface() m_staticNativeWindow = m_window; } else { QReadLocker locker(&m_staticSurfaceLock); - Q_ASSERT(m_staticSurface != m_surface); m_window = m_staticNativeWindow; m_surface = m_staticSurface; } - QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry())); // Expose event + { + lock(); + scheduleResize(QtAndroid::nativeWindowSize()); + QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry())); // Expose event + unlock(); + } + QWindowSystemInterface::flushWindowSystemEvents(); } diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h index 36a110e1a8..9a25957ccd 100644 --- a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h +++ b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.h @@ -71,6 +71,8 @@ public: void destroy(); + static void updateStaticNativeWindow(); + private: QSize m_scheduledResize; QMutex m_lock; diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp index 91ad2b368f..636a2b3853 100644 --- a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp @@ -162,6 +162,7 @@ void QAndroidPlatformIntegration::invalidateNativeSurface() void QAndroidPlatformIntegration::surfaceChanged() { + QAndroidOpenGLPlatformWindow::updateStaticNativeWindow(); foreach (QWindow *w, QGuiApplication::topLevelWindows()) { QAndroidOpenGLPlatformWindow *window = static_cast(w->handle()); From f9da1a21a862ab2964c0e9f366a6cc6e4932ad21 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Mon, 19 Aug 2013 12:30:38 +0200 Subject: [PATCH 2/3] Add changes-5.1.1 file Change-Id: I8b447d1f30918fd31f00bd56cc3eb2f203b847a3 Reviewed-by: Jani Heikkinen Reviewed-by: Iikka Eklund --- dist/changes-5.1.1 | 206 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 dist/changes-5.1.1 diff --git a/dist/changes-5.1.1 b/dist/changes-5.1.1 new file mode 100644 index 0000000000..85309074ed --- /dev/null +++ b/dist/changes-5.1.1 @@ -0,0 +1,206 @@ +Qt 5.1.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.1.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + + http://qt-project.org/doc/qt-5.1/ + +The Qt version 5.1 series is binary compatible with the 5.0.x series. +Applications compiled for 5.0 will continue to run with 5.1. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + + http://bugreports.qt-project.org/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + +**************************************************************************** +* General * +**************************************************************************** + + - Add support for Visual Studio 2013 + - Remove obsolete 'register' C keyword + - Speed up font database loading with fontconfig + - [QTBUG-32284] Fix incomplete override of QIODevice::open in QProcess and QLocalSocket + +**************************************************************************** +* Library * +**************************************************************************** + +QtCore +------ + + - Add basic conversion functions from QVariant(QJsonValue) + - Fix crash when re-creating QThreadData after initially destroying it + - Fix the host_bins variable in the QtCore pkg-config file + - QUrl stringprep: fix handling of U+0080: it's prohibited + - QUrl stringprep: avoid recalculating the surrogates we already know + - QUrl stringprep: fix handling of prohibited characters + - QUrl stringprep: fix case folding from non-BMP to BMP + - QUrl stringprep: recalculate the current position if the size changes + - [QTBUG-24345] Prevent negative size in QBitArray, QVector and QVarLengthArray ctors + - [QTBUG-25732] Mention QRect's int min/max constraints in detailed description + - [QTBUG-29391] fix infinite loop in QProcessPrivate::drainOutputPipes + - [QTBUG-29391] QWinOverlappedIoNotifier: fix race condition + - [QTBUG-31341] Fix watch of files/folders with special characters + - [QTBUG-31606] Fix dead lock in the Qt event handling + - [QTBUG-31926] Fix the number precision in QJsonDocument.toJson() again + - [QTBUG-32100] Remove default argument from declarations of qHash as friend + - [QTBUG-32314] QDir::mkpath shouldn't fail if parent directory denies access + - [QTBUG-32354] fix endless loop in QProcess/Win drainOutputPipes + - [QTBUG-32500] Ensure that the user codecs are listed in QTextCodec::availableCodecs + +QtDBus +------ + + - [QTBUG-27973] Fix disconnectFrom{Peer,Bus} when the connection failed + - [QTBUG-31932] Don't crash if the relayed signal was emitted from the wrong thread + - [QTBUG-32374] Fix QDBusAbstractInterface::isValid() for peer connections + +QtGui +----- + + - Restore smooth-scaled drawing of 0.5x-2.0x scaled glyphs in the GL engine + - QIcon: Avoid fetching twice the same pixmap + - Fix FBO restoring in QOpenGLTextureGlyphCache + - [QTBUG-28284] Set projection matrix for systems with OpenGL 3.1 + - [QTBUG-31443] QPdfWriter: Fix setting of paper size + - [QTBUG-32193] REG: Fix crash when mixing projected/unprojected text painting + - [QTBUG-32433] Detect popup window correctly in modal window blocked handling + +QtNetwork +--------- + + - Correct algorithm for digest auth when using the CONNECT verb + - Add reconnect attempts in more cases in QHttpNetworkConnectionChannel + - [QTBUG-32404] HTTP internals: do not access reply that was deleted already + - [QTBUG-32534] QHttpMultiPart: fix data corruption in readData method + +QtPrintSupport +-------------- + + - [QTBUG-31790] Initialize UI of widget-based dialog. + +QtWidgets +--------- + + - Display sizegrip on QMdiSubWindows, even on OS X 10.7 and later + - Check if widget inherits from QTextEdit when drawing the frame + - Fix QWidget::isActiveWindow for window containers + - Hide placeholder text when QLineEdit has preedit text + - [QTBUG-19036] Make *ItemBoundingRect modes work with custom shapes. + - [QTBUG-29945] Fix dropshadow and blur graphics effects + - [QTBUG-31044] QDockWidget: Keep position when undocking + - [QTBUG-31569] If a QWidget is ignored for auto-quit, ignore its corresponding QWindow + - [QTBUG-31664] Recognize separator item in QMenu + - [QTBUG-31904] Fix rotation of text in vertical QDockWidget titlebars in QFusionStyle + - [QTBUG-32054] Set correct cell when selecting custom color cell with arrow keys + - [QTBUG-32061] Fix the cursor position of an empty QLineEdit with a placeholder text + - [QTBUG-32177] Search toplevel when setting the active window from focus window + - [QTBUG-32260] Consider virtual screen when determining dock widget visibility + + +**************************************************************************** +* Platform Specific Changes * +**************************************************************************** + +Qt for Linux +------------ + + - XCB: Don't use Xlib's XBell() function + - XCB: Append 0-character to atom name string + - Resolve modifier mask conflicts on X11 + - Fix system tray icon on X11 + - [QTBUG-31418] Fix for when we don't have XSettings + - [QTBUG-32274] Fix handling of non-latin1 shortcuts + +Qt for Mac +---------- + + - Disable window restoration for the Mac font panel + - Simplify qt_mac_cgimage_to_nsimage code + - QMacStyle: fix auto-default button animation + - Make the macx-xcode spec a wrapper around the default spec + - Scope cached Mac SDK tool values by mkspec + - Further followup to Q_OS_MACX changes + - Fix QSpinBox clipping issue on Mac when frame=false + - QMacStyle: enable scroll style changes for non-QScrollBars + - Support Mac key equivalent Cmd+Period + - Re-establish platform menu QObject hierarchy + - [QTBUG-28336] Fixed broken prl files in debug-and-release framework builds of qt + - [QTBUG-31477] Let Cocoa pick the right pixmap for menu item icons + - [QTBUG-31532] Don't update the menubar when popups are shown + - [QTBUG-31619] Cocoa save file dialog behavior fix + - [QTBUG-31819] Fix shared color panel usage + - [QTBUG-31562] Fix for OS X QFileDialog showing bundle as directory + - [QTBUG-32440] Avoid a potential crash in unignoredChildren + - [QTBUG-32831] Don't release the printer after using it to change a property + +Qt for Windows +-------------- + + - Clear window under mouse in destruction of platform window + - Prevent activation of windows with Qt::WindowDoesNotAcceptFocus + - Better errorhandling for the fontengine on WINCE + - Windows: Synthesize expose event for shrinking windows + - Windows font database: Resolve aliases for extra fonts + - Bugfix QDesktopServices on Windows + - ActiveQt: Pass native parent handle property from widget to widget window + - REG: Fix character size when exporting PDF on Windows + - Fix crash caused by ~QWindowsWindow flushing the event queue + - Show native file dialog on Windows XP Professional x64 Edition + - Fix detection of synthesized mouse events for MSVC / 64bit + - Display a message box if platform plugin cannot be found + - Fix auto-enabling of windows style + - Fixes QKeyEvent::count() on Windows + +Qt for BlackBerry +----------------- + + - Disable xkbcommon when building for QNX from Windows + - [QTBUG-32385] Handle Qt::WindowDoesNotAcceptFocus correctly + +Qt for Android +-------------- + + - Get SSL root certificates from TrustManager + - Adjust to new SDK layout on Windows + - Make PCRE's JIT work on Android devices + +Qt for iOS +---------- + + - iOS: Make sure we're deleting framebuffers in the right context + +**************************************************************************** +* Tools * +**************************************************************************** + +- configure + + * [QTBUG-5366] Complain about bad arguments to -make/-nomake + * [QTBUG-21778] Catch accidental use of -no-make + * [QTBUG-28763] Don't enable EGL support if OpenGL is disabled + +- cmake config files + + * Use absolute path in the /usr move workaround if -libdir is specified + * Always use forward slashes in paths passed to cmake + * Make clients use the QT_NO_DEBUG flag when using QtCore in release mode + * [QTBUG-32134] Add path to the headers in frameworks to the include dirs + * [QTBUG-32466] Don't check for the existence of private include directories + +- qmake + + * [QTBUG-5301] basic manifest tool support in vc(x)proj generator + * [QTBUG-19352] Resolve output of .depend_command relative to $$OUT_PWD + * [QTBUG-29826] Only add the res_file to the generated files if there is no rc_file + * [QTBUG-29988] VPATH resolution: don't crash when $(FOO) expands to nothing + * [QTBUG-30993] Changed project dependencies for solution files + * [QTBUG-31877] Make $$list() more backwards-compatible regarding backslashes + * [QTBUG-31975] MANIFEST:NO is not written to vcproj + * [QTBUG-32326] Escape paths coming from prl files From c15a8cc283d5d7b26677b9c71cabb1f5f47494f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 21 Aug 2013 15:05:19 +0200 Subject: [PATCH 3/3] Don't use qt_mac_get_fixed_pitch() to resolve fixed pitch fonts on OSX The call was resulting in inifinite recursion on OSX 10.9 when Qt was built against the 10.7 SDK, as qt_mac_get_fixed_pitch uses QFontMetrics to resolve the pitch, and we would end up in the font resolver again when asking for the metrics. The CoreText font-database already takes care of resolving whether or not a font family is fixed-pitch, so the code is likely a leftover from the ATSUI-days, and can be removed. Task-number: QTBUG-31803 Change-Id: I37c90fa637927eb4adc16c0fd556c4c46c456034 Reviewed-by: Gabriel de Dietrich (cherry picked from commit bd9a023a41209a216eec28bd25a20372a5172b6a) Reviewed-by: Jani Heikkinen Reviewed-by: Iikka Eklund --- src/gui/text/qfontdatabase.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 62379cd592..54b4629ca0 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -314,9 +314,6 @@ struct QtFontFamily QtFontFamily(const QString &n) : fixedPitch(false), -#if !defined(QWS) && defined(Q_OS_MAC) - fixedPitchComputed(false), -#endif name(n), count(0), foundries(0) , bogusWritingSystems(false) , askedForFallback(false) @@ -330,9 +327,6 @@ struct QtFontFamily } bool fixedPitch : 1; -#if !defined(QWS) && defined(Q_OS_MAC) - bool fixedPitchComputed : 1; -#endif QString name; QStringList aliases; @@ -348,18 +342,6 @@ struct QtFontFamily QtFontFoundry *foundry(const QString &f, bool = false); }; -#if !defined(QWS) && defined(Q_OS_MAC) -inline static void qt_mac_get_fixed_pitch(QtFontFamily *f) -{ - if(f && !f->fixedPitchComputed) { - QFontMetrics fm(f->name); - f->fixedPitch = fm.width(QLatin1Char('i')) == fm.width(QLatin1Char('m')); - f->fixedPitchComputed = true; - } -} -#endif - - QtFontFoundry *QtFontFamily::foundry(const QString &f, bool create) { if (f.isNull() && count == 1) @@ -823,9 +805,6 @@ unsigned int bestFoundry(int script, unsigned int score, int styleStrategy, EncodingMismatch = 0x0002 }; if (pitch != '*') { -#if !defined(QWS) && defined(Q_OS_MAC) - qt_mac_get_fixed_pitch(const_cast(family)); -#endif if ((pitch == 'm' && !family->fixedPitch) || (pitch == 'p' && family->fixedPitch)) this_score += PitchMismatch; @@ -1263,9 +1242,6 @@ bool QFontDatabase::isFixedPitch(const QString &family, QT_PREPEND_NAMESPACE(load)(familyName); QtFontFamily *f = d->family(familyName); -#if !defined(QWS) && defined(Q_OS_MAC) - qt_mac_get_fixed_pitch(f); -#endif return (f && f->fixedPitch); }