winrt: Fix window resize
The fixed-size EGL display must be updated on PC as well as Windows Phone. Task-number: QTBUG-43112 Change-Id: I0ba90370b67e8c065843e5754579e341b647266d Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
This commit is contained in:
parent
bd5743f1d8
commit
5367fa3562
@ -1081,12 +1081,14 @@ HRESULT QWinRTScreen::onSizeChanged(ICoreWindow *, IWindowSizeChangedEventArgs *
|
|||||||
d->logicalSize = logicalSize;
|
d->logicalSize = logicalSize;
|
||||||
if (d->eglDisplay) {
|
if (d->eglDisplay) {
|
||||||
const QRect newGeometry = geometry();
|
const QRect newGeometry = geometry();
|
||||||
#ifdef Q_OS_WINPHONE // Resize the EGL window
|
int width = newGeometry.width();
|
||||||
const int width = newGeometry.width() * (d->orientation == Qt::InvertedPortraitOrientation || d->orientation == Qt::LandscapeOrientation ? -1 : 1);
|
int height = newGeometry.height();
|
||||||
const int height = newGeometry.height() * (d->orientation == Qt::InvertedPortraitOrientation || d->orientation == Qt::InvertedLandscapeOrientation ? -1 : 1);
|
#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_WIDTH, width);
|
||||||
eglSurfaceAttrib(d->eglDisplay, d->eglSurface, EGL_HEIGHT, height);
|
eglSurfaceAttrib(d->eglDisplay, d->eglSurface, EGL_HEIGHT, height);
|
||||||
#endif
|
|
||||||
QWindowSystemInterface::handleScreenGeometryChange(screen(), newGeometry, newGeometry);
|
QWindowSystemInterface::handleScreenGeometryChange(screen(), newGeometry, newGeometry);
|
||||||
QPlatformScreen::resizeMaximizedWindows();
|
QPlatformScreen::resizeMaximizedWindows();
|
||||||
handleExpose();
|
handleExpose();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user