From 9656e972d194ab41bbb8aea82d77af62bcd647e8 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 20 Jun 2017 14:10:17 +0200 Subject: Remove remains of wince in .pro files Task-number: QTBUG-52590 Change-Id: I444fc9eedc8a8e4ad2ede224d66e7c410bedbb48 Reviewed-by: Maurice Kalinowski Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- src/plugins/plugins.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro index 620d9cb8c9..6d62420bd6 100644 --- a/src/plugins/plugins.pro +++ b/src/plugins/plugins.pro @@ -9,5 +9,5 @@ qtHaveModule(gui) { !android:qtConfig(library): SUBDIRS *= generic } -!winrt:!wince:qtHaveModule(printsupport): \ +!winrt:qtHaveModule(printsupport): \ SUBDIRS += printsupport -- cgit v1.2.3 From 3e8ebea95b634c7ded9ee0b884768155e9e7f686 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 23 Jun 2017 09:08:19 +0200 Subject: Cocoa: Reset the target + action for a menuitem after showing a dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To make it more reliable and efficient we now do the reverse of what we are doing when redirecting the items. This will ensure that the actions are correctly reset to the original target and action. The original approach of updateMenubarImmediately() was not always doing this and it also does other unnecessary things as a result when all we need is to just reset the things we changed. Change-Id: Icefa38d47ec9434894f05caeed75fbf8bdfecb93 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoamenubar.mm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm index 82c405baa6..4cdf004dd1 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.mm +++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm @@ -303,7 +303,23 @@ void QCocoaMenuBar::resetKnownMenuItemsToQt() // Undo the effect of redirectKnownMenuItemsToFirstResponder(): // set the menu items' actions to itemFired and their targets to // the QCocoaMenuDelegate. - updateMenuBarImmediately(); + foreach (QCocoaMenuBar *mb, static_menubars) { + foreach (QCocoaMenu *m, mb->m_menus) { + foreach (QCocoaMenuItem *i, m->items()) { + switch (i->effectiveRole()) { + case QPlatformMenuItem::CutRole: + case QPlatformMenuItem::CopyRole: + case QPlatformMenuItem::PasteRole: + case QPlatformMenuItem::SelectAllRole: + [i->nsItem() setTarget:m->nsMenu().delegate]; + [i->nsItem() setAction:@selector(itemFired:)]; + break; + default: + break; + } + } + } + } } void QCocoaMenuBar::updateMenuBarImmediately() -- cgit v1.2.3 From 46312b611b4aa04d32eab05668d84f09e6aa6670 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Wed, 22 Feb 2017 14:33:56 +0300 Subject: xcb: Use QT_CONFIG macro to check for xcb-sm, xcb-render, and xcb-glx And remove the corresponding defines. Note that XCB_USE_GLX and XCB_HAS_XCB_GLX were used as synonyms because QGLXBufferSwapComplete was wrapped in #if defined(XCB_USE_GLX) and at the same time it was used only when XCB_HAS_XCB_GLX was defined. Change-Id: I6c04b0ccfd5369b78b3e8af2ec39d38ae5c311dc Reviewed-by: Gatis Paeglis --- .../gl_integrations_plugin_base.pri | 11 +--- .../gl_integrations/xcb_glx/qxcbglxintegration.cpp | 65 +++++++++++----------- .../xcb/gl_integrations/xcb_glx/xcb_glx.pro | 7 +-- src/plugins/platforms/xcb/qxcbconnection.cpp | 8 +-- src/plugins/platforms/xcb/qxcbimage.cpp | 4 +- src/plugins/platforms/xcb/qxcbintegration.cpp | 2 +- src/plugins/platforms/xcb/qxcbintegration.h | 3 +- src/plugins/platforms/xcb/xcb_qpa_lib.pro | 9 +-- 8 files changed, 43 insertions(+), 66 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri b/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri index e6e352a21d..df471f1105 100644 --- a/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri +++ b/src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri @@ -5,19 +5,10 @@ INCLUDEPATH += $$PWD/../ load(qt_build_paths) -# build with session management support -qtConfig(xcb-sm) { - DEFINES += XCB_USE_SM -} - !qtConfig(system-xcb) { - DEFINES += XCB_USE_RENDER QMAKE_USE += xcb-static xcb } else { qtConfig(xkb): QMAKE_USE += xcb_xkb - # to support custom cursors with depth > 1 - qtConfig(xcb-render) { - DEFINES += XCB_USE_RENDER - } + qtConfig(xcb-render): QMAKE_USE += xcb_render QMAKE_USE += xcb_syslibs } diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp index a283d451f8..fea365cabc 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qxcbglxintegration.cpp @@ -39,7 +39,7 @@ #include "qxcbglxintegration.h" -#if defined(XCB_HAS_XCB_GLX) +#if QT_CONFIG(xcb_glx) #include #endif @@ -56,37 +56,34 @@ QT_BEGIN_NAMESPACE -#if defined(XCB_HAS_XCB_GLX) && XCB_GLX_MAJOR_VERSION == 1 && XCB_GLX_MINOR_VERSION < 4 - -#define XCB_GLX_BUFFER_SWAP_COMPLETE 1 - -typedef struct xcb_glx_buffer_swap_complete_event_t { - uint8_t response_type; - uint8_t pad0; - uint16_t sequence; - uint16_t event_type; - uint8_t pad1[2]; - xcb_glx_drawable_t drawable; - uint32_t ust_hi; - uint32_t ust_lo; - uint32_t msc_hi; - uint32_t msc_lo; - uint32_t sbc; -} xcb_glx_buffer_swap_complete_event_t; -#endif - -#if defined(XCB_USE_GLX) -typedef struct { - int type; - unsigned long serial; /* # of last request processed by server */ - Bool send_event; /* true if this came from a SendEvent request */ - Display *display; /* Display the event was read from */ - Drawable drawable; /* drawable on which event was requested in event mask */ - int event_type; - int64_t ust; - int64_t msc; - int64_t sbc; -} QGLXBufferSwapComplete; +#if QT_CONFIG(xcb_glx) + #if XCB_GLX_MAJOR_VERSION == 1 && XCB_GLX_MINOR_VERSION < 4 + #define XCB_GLX_BUFFER_SWAP_COMPLETE 1 + typedef struct xcb_glx_buffer_swap_complete_event_t { + uint8_t response_type; + uint8_t pad0; + uint16_t sequence; + uint16_t event_type; + uint8_t pad1[2]; + xcb_glx_drawable_t drawable; + uint32_t ust_hi; + uint32_t ust_lo; + uint32_t msc_hi; + uint32_t msc_lo; + uint32_t sbc; + } xcb_glx_buffer_swap_complete_event_t; + #endif + typedef struct { + int type; + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Drawable drawable; /* drawable on which event was requested in event mask */ + int event_type; + int64_t ust; + int64_t msc; + int64_t sbc; + } QGLXBufferSwapComplete; #endif QXcbGlxIntegration::QXcbGlxIntegration() @@ -103,7 +100,7 @@ QXcbGlxIntegration::~QXcbGlxIntegration() bool QXcbGlxIntegration::initialize(QXcbConnection *connection) { m_connection = connection; -#ifdef XCB_HAS_XCB_GLX +#if QT_CONFIG(xcb_glx) const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_connection->xcb_connection(), &xcb_glx_id); if (!reply || !reply->present) @@ -145,7 +142,7 @@ bool QXcbGlxIntegration::handleXcbEvent(xcb_generic_event_t *event, uint respons XEvent dummy; event->sequence = LastKnownRequestProcessed(xdisplay); if (proc(xdisplay, &dummy, (xEvent*)event)) { -#ifdef XCB_HAS_XCB_GLX +#if QT_CONFIG(xcb_glx) // DRI2 clients don't receive GLXBufferSwapComplete events on the wire. // Instead the GLX event is synthesized from the DRI2BufferSwapComplete event // by DRI2WireToEvent(). For an application to be able to see the event diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro index 5af6172301..9d537b18f3 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/xcb_glx.pro @@ -3,14 +3,9 @@ TARGET = qxcb-glx-integration include(../gl_integrations_plugin_base.pri) QT += glx_support-private -#should be removed from the sources -DEFINES += XCB_USE_GLX DEFINES += QT_NO_FOREACH -qtConfig(xcb-glx) { - DEFINES += XCB_HAS_XCB_GLX - QMAKE_USE += xcb_glx -} +qtConfig(xcb-glx): QMAKE_USE += xcb_glx !static:qtConfig(dlopen): QMAKE_USE += libdl diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index cd170e3dbc..e167ba1231 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -80,7 +80,7 @@ #include #endif -#ifdef XCB_USE_RENDER +#if QT_CONFIG(xcb_render) #include #endif @@ -583,7 +583,7 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra #if QT_CONFIG(xkb) &xcb_xkb_id, #endif -#ifdef XCB_USE_RENDER +#if QT_CONFIG(xcb_render) &xcb_render_id, #endif 0 @@ -1533,7 +1533,7 @@ xcb_window_t QXcbConnection::clientLeader() 1, &m_clientLeader)); -#if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) +#if QT_CONFIG(xcb_sm) // If we are session managed, inform the window manager about it QByteArray session = qGuiApp->sessionId().toLatin1(); if (!session.isEmpty()) { @@ -2067,7 +2067,7 @@ void QXcbConnection::initializeXFixes() void QXcbConnection::initializeXRender() { -#ifdef XCB_USE_RENDER +#if QT_CONFIG(xcb_render) const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_connection, &xcb_render_id); if (!reply || !reply->present) return; diff --git a/src/plugins/platforms/xcb/qxcbimage.cpp b/src/plugins/platforms/xcb/qxcbimage.cpp index d4bdb6c771..c0403d589d 100644 --- a/src/plugins/platforms/xcb/qxcbimage.cpp +++ b/src/plugins/platforms/xcb/qxcbimage.cpp @@ -41,7 +41,7 @@ #include #include #include -#ifdef XCB_USE_RENDER +#if QT_CONFIG(xcb_render) #include // 'template' is used as a function argument name in xcb_renderutil.h #define template template_param @@ -199,7 +199,7 @@ xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image) xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot) { -#ifdef XCB_USE_RENDER +#if QT_CONFIG(xcb_render) xcb_connection_t *conn = screen->xcb_connection(); const int w = image.width(); const int h = image.height(); diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index e742e91f7d..859b55b0d8 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -455,7 +455,7 @@ QByteArray QXcbIntegration::wmClass() const return m_wmClass; } -#if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) +#if QT_CONFIG(xcb_sm) QPlatformSessionManager *QXcbIntegration::createPlatformSessionManager(const QString &id, const QString &key) const { return new QXcbSessionManager(id, key); diff --git a/src/plugins/platforms/xcb/qxcbintegration.h b/src/plugins/platforms/xcb/qxcbintegration.h index baa5c9d835..b3d72c19d0 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.h +++ b/src/plugins/platforms/xcb/qxcbintegration.h @@ -40,6 +40,7 @@ #ifndef QXCBINTEGRATION_H #define QXCBINTEGRATION_H +#include #include #include @@ -105,7 +106,7 @@ public: QByteArray wmClass() const; -#if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM) +#if QT_CONFIG(xcb_sm) QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const override; #endif diff --git a/src/plugins/platforms/xcb/xcb_qpa_lib.pro b/src/plugins/platforms/xcb/xcb_qpa_lib.pro index d0dc8f3075..1c76b49650 100644 --- a/src/plugins/platforms/xcb/xcb_qpa_lib.pro +++ b/src/plugins/platforms/xcb/xcb_qpa_lib.pro @@ -58,9 +58,7 @@ qtConfig(xcb-xlib) { } } -# build with session management support qtConfig(xcb-sm) { - DEFINES += XCB_USE_SM QMAKE_USE += x11sm SOURCES += qxcbsessionmanager.cpp HEADERS += qxcbsessionmanager.h @@ -69,16 +67,11 @@ qtConfig(xcb-sm) { include(gl_integrations/gl_integrations.pri) !qtConfig(system-xcb) { - DEFINES += XCB_USE_RENDER QMAKE_USE += xcb-static xcb } else { LIBS += -lxcb-xinerama ### there is no configure test for this! qtConfig(xkb): QMAKE_USE += xcb_xkb - # to support custom cursors with depth > 1 - qtConfig(xcb-render) { - DEFINES += XCB_USE_RENDER - QMAKE_USE += xcb_render - } + qtConfig(xcb-render): QMAKE_USE += xcb_render QMAKE_USE += xcb_syslibs } -- cgit v1.2.3 From 5dcd9491454390b198db1d2ab45b0b418d926cde Mon Sep 17 00:00:00 2001 From: Christian Stromme Date: Wed, 7 Jun 2017 15:46:07 +0200 Subject: Android: Add lock to protect access to the platform interface Fixes dubious lock protecting the platform interface handle, and makes sure that we lock and hold a valid reference to the platform interface before accessing it. Since the platform interface is exposed we also need to expose the mutex protecting it. Change-Id: I1ec1219a75c589bc793676369b11fb403de20102 Reviewed-by: BogDan Vatra --- .../platforms/android/androidjniaccessibility.cpp | 1 + src/plugins/platforms/android/androidjniinput.cpp | 1 + src/plugins/platforms/android/androidjnimain.cpp | 50 +++++++++------------- src/plugins/platforms/android/androidjnimain.h | 2 + .../android/qandroidplatformintegration.cpp | 9 +++- 5 files changed, 32 insertions(+), 31 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/android/androidjniaccessibility.cpp b/src/plugins/platforms/android/androidjniaccessibility.cpp index eeaecd53b4..06624415d3 100644 --- a/src/plugins/platforms/android/androidjniaccessibility.cpp +++ b/src/plugins/platforms/android/androidjniaccessibility.cpp @@ -80,6 +80,7 @@ namespace QtAndroidAccessibility static void setActive(JNIEnv */*env*/, jobject /*thiz*/, jboolean active) { + QMutexLocker lock(QtAndroid::platformInterfaceMutex()); QAndroidPlatformIntegration *platformIntegration = QtAndroid::androidPlatformIntegration(); if (platformIntegration) platformIntegration->accessibility()->setActive(active); diff --git a/src/plugins/platforms/android/androidjniinput.cpp b/src/plugins/platforms/android/androidjniinput.cpp index ef95b80dd4..f19b7d5484 100644 --- a/src/plugins/platforms/android/androidjniinput.cpp +++ b/src/plugins/platforms/android/androidjniinput.cpp @@ -272,6 +272,7 @@ namespace QtAndroidInput if (m_touchPoints.isEmpty()) return; + QMutexLocker lock(QtAndroid::platformInterfaceMutex()); QAndroidPlatformIntegration *platformIntegration = QtAndroid::androidPlatformIntegration(); if (!platformIntegration) return; diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index 06bca0354d..4f95e84283 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -83,7 +83,7 @@ static jmethodID m_setSurfaceGeometryMethodID = nullptr; static jmethodID m_destroySurfaceMethodID = nullptr; static int m_pendingApplicationState = -1; -static QBasicMutex m_pendingAppStateMtx; +static QBasicMutex m_platformMutex; static jclass m_bitmapClass = nullptr; static jmethodID m_createBitmapMethodID = nullptr; @@ -123,28 +123,26 @@ static const char m_qtTag[] = "Qt"; static const char m_classErrorMsg[] = "Can't find class \"%s\""; static const char m_methodErrorMsg[] = "Can't find method \"%s%s\""; -static void flushPendingApplicationState(); - namespace QtAndroid { + QBasicMutex *platformInterfaceMutex() + { + return &m_platformMutex; + } + void setAndroidPlatformIntegration(QAndroidPlatformIntegration *androidPlatformIntegration) { - QMutexLocker lock(&m_surfacesMutex); m_androidPlatformIntegration = androidPlatformIntegration; // flush the pending state if necessary. - if (m_androidPlatformIntegration) { - flushPendingApplicationState(); - m_androidPlatformIntegration->flushPendingUpdates(); - } else { - QMutexLocker locker(&m_pendingAppStateMtx); - m_pendingApplicationState = -1; - } + if (m_androidPlatformIntegration && (m_pendingApplicationState != -1)) + QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState(m_pendingApplicationState)); + + m_pendingApplicationState = -1; } QAndroidPlatformIntegration *androidPlatformIntegration() { - QMutexLocker locker(&m_surfacesMutex); return m_androidPlatformIntegration; } @@ -443,17 +441,6 @@ namespace QtAndroid } // namespace QtAndroid -// Force an update of the pending application state (state set before the platform plugin was created) -static void flushPendingApplicationState() -{ - QMutexLocker locker(&m_pendingAppStateMtx); - if (m_pendingApplicationState == -1) - return; - - QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState(m_pendingApplicationState)); - m_pendingApplicationState = -1; -} - static jboolean startQtAndroidPlugin(JNIEnv* /*env*/, jobject /*object*//*, jobject applicationAssetManager*/) { m_androidPlatformIntegration = nullptr; @@ -621,7 +608,7 @@ static void setDisplayMetrics(JNIEnv */*env*/, jclass /*clazz*/, m_scaledDensity = scaledDensity; m_density = density; - QMutexLocker lock(&m_surfacesMutex); + QMutexLocker lock(&m_platformMutex); if (!m_androidPlatformIntegration) { QAndroidPlatformIntegration::setDefaultDisplayMetrics(desktopWidthPixels, desktopHeightPixels, @@ -663,18 +650,22 @@ static void updateWindow(JNIEnv */*env*/, jobject /*thiz*/) static void updateApplicationState(JNIEnv */*env*/, jobject /*thiz*/, jint state) { - if (!m_main || !QtAndroid::androidPlatformIntegration()) { - QMutexLocker locker(&m_pendingAppStateMtx); - m_pendingApplicationState = Qt::ApplicationState(state); + QMutexLocker lock(&m_platformMutex); + if (!m_main || !m_androidPlatformIntegration) { + m_pendingApplicationState = state; return; } - flushPendingApplicationState(); - + // We're about to call user code from the Android thread, since we don't know + //the side effects we'll unlock first! + lock.unlock(); if (state == Qt::ApplicationActive) QtAndroidPrivate::handleResume(); else if (state == Qt::ApplicationInactive) QtAndroidPrivate::handlePause(); + lock.relock(); + if (!m_androidPlatformIntegration) + return; if (state <= Qt::ApplicationInactive) { // NOTE: sometimes we will receive two consecutive suspended notifications, @@ -722,6 +713,7 @@ static void handleOrientationChanged(JNIEnv */*env*/, jobject /*thiz*/, jint new Qt::ScreenOrientation native = orientations[nativeOrientation - 1]; QAndroidPlatformIntegration::setScreenOrientation(screenOrientation, native); + QMutexLocker lock(&m_platformMutex); if (m_androidPlatformIntegration) { QPlatformScreen *screen = m_androidPlatformIntegration->screen(); QWindowSystemInterface::handleScreenOrientationChange(screen->screen(), diff --git a/src/plugins/platforms/android/androidjnimain.h b/src/plugins/platforms/android/androidjnimain.h index 170596082d..08f1d50fe3 100644 --- a/src/plugins/platforms/android/androidjnimain.h +++ b/src/plugins/platforms/android/androidjnimain.h @@ -58,9 +58,11 @@ class QWidget; class QString; class QWindow; class AndroidSurfaceClient; +class QBasicMutex; namespace QtAndroid { + QBasicMutex *platformInterfaceMutex(); QAndroidPlatformIntegration *androidPlatformIntegration(); void setAndroidPlatformIntegration(QAndroidPlatformIntegration *androidPlatformIntegration); void setQtThread(QThread *thread); diff --git a/src/plugins/platforms/android/qandroidplatformintegration.cpp b/src/plugins/platforms/android/qandroidplatformintegration.cpp index 403badb2e1..7185b573cd 100644 --- a/src/plugins/platforms/android/qandroidplatformintegration.cpp +++ b/src/plugins/platforms/android/qandroidplatformintegration.cpp @@ -121,8 +121,13 @@ void *QAndroidPlatformNativeInterface::nativeResourceForIntegration(const QByteA void QAndroidPlatformNativeInterface::customEvent(QEvent *event) { - if (event->type() == QEvent::User) - QtAndroid::setAndroidPlatformIntegration(static_cast(QGuiApplicationPrivate::platformIntegration())); + if (event->type() != QEvent::User) + return; + + QMutexLocker lock(QtAndroid::platformInterfaceMutex()); + QAndroidPlatformIntegration *api = static_cast(QGuiApplicationPrivate::platformIntegration()); + QtAndroid::setAndroidPlatformIntegration(api); + api->flushPendingUpdates(); } QAndroidPlatformIntegration::QAndroidPlatformIntegration(const QStringList ¶mList) -- cgit v1.2.3 From 50a7da53a47e6b0455fffaf8bdb19ef683b11ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Tue, 23 May 2017 17:21:14 +0200 Subject: Android: Replace QMutex with QBasicMutex in androidjnimain QBasicMutex is sufficient and provides reduced initialization cost. Change-Id: I79ae61daaed4f5edd9b21d913f78e78e7ba14c94 Reviewed-by: BogDan Vatra --- src/plugins/platforms/android/androidjnimain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index 4f95e84283..ad2fef7070 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -104,7 +104,7 @@ static sem_t m_exitSemaphore, m_terminateSemaphore; QHash m_surfaces; -static QMutex m_surfacesMutex; +static QBasicMutex m_surfacesMutex; static int m_surfaceId = 1; -- cgit v1.2.3 From c854fc5a6be1e94d2ea313a1d0ef637bc3df178f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 3 Jul 2017 14:40:32 +0200 Subject: Windows QPA: Correctly check for fixed sized windows in WM_DPICHANGED Use Qt's flags instead of WS_DLGFRAME which matches WS_CAPTION as well (WS_BORDER | WS_DLGFRAME). Amends 886ce572d628e7cd98cc39edcc930ffae951e95e. Task-number: QTBUG-58959 Change-Id: Ifdc106667d67cc6f5d3611806aae1035742fb882 Reviewed-by: Olivier Goffart (Woboq GmbH) Reviewed-by: Alexandru Croitor --- src/plugins/platforms/windows/qwindowscontext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 38f2be7a73..a042212dd3 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -1106,7 +1106,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, #endif } break; case QtWindows::DpiChangedEvent: { - if (GetWindowLongPtr(hwnd, GWL_STYLE) & WS_DLGFRAME) + if (platformWindow->window()->flags().testFlag(Qt::MSWindowsFixedSizeDialogHint)) return false; // Fixed-size window should not be resized platformWindow->setFlag(QWindowsWindow::WithinDpiChanged); -- cgit v1.2.3