diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-12-05 11:53:33 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2014-12-05 11:53:33 +0100 |
commit | 7644faa881d3054e79cf886dc60080ba33dd540a (patch) | |
tree | 37610e42031ffd3bbb6522d7c6bd9070684b8d17 /src/plugins/platforms | |
parent | e682ea6f782d3bb4caa4f2bd0e3be47cbe064f4f (diff) | |
parent | 5367fa356233da4c0f28172a8f817791525f5457 (diff) |
Merge remote-tracking branch 'origin/5.4.0' into 5.4
Change-Id: I0cd11cbe95693b78450ea81a0187760f4a6a8b5f
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/android/qandroidplatformtheme.cpp | 3 | ||||
-rw-r--r-- | src/plugins/platforms/winrt/qwinrtscreen.cpp | 23 |
2 files changed, 21 insertions, 5 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformtheme.cpp b/src/plugins/platforms/android/qandroidplatformtheme.cpp index 8cece443b1..d9f062576b 100644 --- a/src/plugins/platforms/android/qandroidplatformtheme.cpp +++ b/src/plugins/platforms/android/qandroidplatformtheme.cpp @@ -278,7 +278,8 @@ static std::shared_ptr<AndroidStyle> loadAndroidStyle(QPalette *defaultPalette) const int pt = paletteType(key); if (pt > -1 || !qtClassName.isEmpty()) { // Extract palette information - QPalette palette; + QPalette palette = *defaultPalette; + attributeIterator = item.find(QLatin1String("defaultTextColorPrimary")); if (attributeIterator != item.constEnd()) palette.setColor(QPalette::WindowText, QRgb(int(attributeIterator.value().toDouble()))); diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp index fadcd01b06..37a3ff3d63 100644 --- a/src/plugins/platforms/winrt/qwinrtscreen.cpp +++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp @@ -37,6 +37,9 @@ #include <EGL/eglext.h> #include <d3d11.h> #include <dxgi1_2.h> +#ifndef Q_OS_WINPHONE +#include <dxgi1_3.h> +#endif #include "qwinrtbackingstore.h" #include "qwinrtinputcontext.h" @@ -1078,12 +1081,14 @@ HRESULT QWinRTScreen::onSizeChanged(ICoreWindow *, IWindowSizeChangedEventArgs * d->logicalSize = logicalSize; if (d->eglDisplay) { const QRect newGeometry = geometry(); -#ifdef Q_OS_WINPHONE // Resize the EGL window - const int width = newGeometry.width() * (d->orientation == Qt::InvertedPortraitOrientation || d->orientation == Qt::LandscapeOrientation ? -1 : 1); - const int height = newGeometry.height() * (d->orientation == Qt::InvertedPortraitOrientation || d->orientation == Qt::InvertedLandscapeOrientation ? -1 : 1); + int width = newGeometry.width(); + int height = newGeometry.height(); +#ifdef Q_OS_WINPHONE // Windows Phone can pass in a negative size to provide orientation information + width *= (d->orientation == Qt::InvertedPortraitOrientation || d->orientation == Qt::LandscapeOrientation) ? -1 : 1; + height *= (d->orientation == Qt::InvertedPortraitOrientation || d->orientation == Qt::InvertedLandscapeOrientation) ? -1 : 1; +#endif eglSurfaceAttrib(d->eglDisplay, d->eglSurface, EGL_WIDTH, width); eglSurfaceAttrib(d->eglDisplay, d->eglSurface, EGL_HEIGHT, height); -#endif QWindowSystemInterface::handleScreenGeometryChange(screen(), newGeometry, newGeometry); QPlatformScreen::resizeMaximizedWindows(); handleExpose(); @@ -1113,6 +1118,16 @@ HRESULT QWinRTScreen::onActivated(ICoreWindow *, IWindowActivatedEventArgs *args HRESULT QWinRTScreen::onSuspended(IInspectable *, ISuspendingEventArgs *) { +#ifndef Q_OS_WINPHONE + Q_D(QWinRTScreen); + ComPtr<ID3D11Device> d3dDevice; + const EGLBoolean ok = eglQuerySurfacePointerANGLE(d->eglDisplay, EGL_NO_SURFACE, EGL_DEVICE_EXT, (void **)d3dDevice.GetAddressOf()); + if (ok && d3dDevice) { + ComPtr<IDXGIDevice3> dxgiDevice; + if (SUCCEEDED(d3dDevice.As(&dxgiDevice))) + dxgiDevice->Trim(); + } +#endif QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended); QWindowSystemInterface::flushWindowSystemEvents(); return S_OK; |