summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/winrt
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2014-12-10 07:58:06 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2014-12-10 07:58:06 +0100
commit015002fec9abff6a4c1bb3fa4b9de87279a079c3 (patch)
treead93af535a503d0a49d6c6367e990a8fbca163d3 /src/plugins/platforms/winrt
parentf1e00262321cc8daa3c7506153653453e2779886 (diff)
parentb9547af45ea2bbbc634722c1ef41afdb54216ce2 (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts: doc/global/template/style/online.css mkspecs/android-g++/qmake.conf Change-Id: Ib39ea7bd42f5ae12e82a3bc59a66787a16bdfc61
Diffstat (limited to 'src/plugins/platforms/winrt')
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp23
1 files changed, 19 insertions, 4 deletions
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;