winrt: Handle WaitForWindowExposed
As winrt does not have native windows, exposure check was just done by checking, whether the window is the active window. If a window is shown fullscreen though, winrtscreen will be resized. This resize triggers a resize of every maximized or fullscreen window that is shown. If we enter or leave full screen mode, we have to wait until the screen resize and the subsequent window resizes are done and only then we can consider the windows properly exposed. This patch reverts 54bcb9d42f5ceaafcca426dc2a5cc25d299d5a3d and thus unblacklists tst_QGraphicsItem::cursor on WinRT. Fixes: QTBUG-73545 Change-Id: If469fce319ed6b3a5d56b7bf3cbc11929b72bb11 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
This commit is contained in:
parent
083c03e22b
commit
a2c9f9433a
@ -511,6 +511,7 @@ public:
|
||||
QWindow *currentPressWindow = nullptr;
|
||||
QWindow *currentTargetWindow = nullptr;
|
||||
bool firstMouseMove = true;
|
||||
bool resizePending = false;
|
||||
};
|
||||
|
||||
// To be called from the XAML thread
|
||||
@ -1402,6 +1403,18 @@ void QWinRTScreen::emulateMouseMove(const QPointF &point, MousePositionTransitio
|
||||
Qt::NoModifier);
|
||||
}
|
||||
|
||||
void QWinRTScreen::setResizePending()
|
||||
{
|
||||
Q_D(QWinRTScreen);
|
||||
d->resizePending = true;
|
||||
}
|
||||
|
||||
bool QWinRTScreen::resizePending() const
|
||||
{
|
||||
Q_D(const QWinRTScreen);
|
||||
return d->resizePending;
|
||||
}
|
||||
|
||||
HRESULT QWinRTScreen::onActivated(ICoreWindow *, IWindowActivatedEventArgs *args)
|
||||
{
|
||||
Q_D(QWinRTScreen);
|
||||
@ -1507,7 +1520,7 @@ HRESULT QWinRTScreen::onRedirectReleased(ICorePointerRedirector *, IPointerEvent
|
||||
return onPointerUpdated(nullptr, args);
|
||||
}
|
||||
|
||||
HRESULT QWinRTScreen::onWindowSizeChanged(IApplicationView *, IInspectable *)
|
||||
HRESULT QWinRTScreen::onWindowSizeChanged(IApplicationView *w, IInspectable *)
|
||||
{
|
||||
Q_D(QWinRTScreen);
|
||||
|
||||
@ -1527,6 +1540,9 @@ HRESULT QWinRTScreen::onWindowSizeChanged(IApplicationView *, IInspectable *)
|
||||
QWindowSystemInterface::handleScreenGeometryChange(screen(), geometry(), availableGeometry());
|
||||
QPlatformScreen::resizeMaximizedWindows();
|
||||
handleExpose();
|
||||
// If we "emulate" a resize, w will be nullptr.Checking w shows whether it's a real resize
|
||||
if (w)
|
||||
d->resizePending = false;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -136,6 +136,9 @@ public:
|
||||
|
||||
void emulateMouseMove(const QPointF &point, MousePositionTransition transition);
|
||||
|
||||
void setResizePending();
|
||||
bool resizePending() const;
|
||||
|
||||
private:
|
||||
void handleExpose();
|
||||
|
||||
|
@ -225,7 +225,8 @@ bool QWinRTWindow::isActive() const
|
||||
|
||||
bool QWinRTWindow::isExposed() const
|
||||
{
|
||||
const bool exposed = isActive();
|
||||
Q_D(const QWinRTWindow);
|
||||
const bool exposed = isActive() && !d->screen->resizePending();
|
||||
return exposed;
|
||||
}
|
||||
|
||||
@ -360,6 +361,7 @@ void QWinRTWindow::setWindowState(Qt::WindowStates state)
|
||||
qCDebug(lcQpaWindows) << "Failed to enter full screen mode.";
|
||||
return;
|
||||
}
|
||||
d->screen->setResizePending();
|
||||
d->state = state;
|
||||
return;
|
||||
}
|
||||
@ -384,6 +386,7 @@ void QWinRTWindow::setWindowState(Qt::WindowStates state)
|
||||
qCDebug(lcQpaWindows) << "Failed to exit full screen mode.";
|
||||
return;
|
||||
}
|
||||
d->screen->setResizePending();
|
||||
}
|
||||
|
||||
if (d->state & Qt::WindowMinimized || state == Qt::WindowNoState || state == Qt::WindowActive)
|
||||
|
@ -1,3 +0,0 @@
|
||||
[cursor]
|
||||
# QTBUG-73545
|
||||
winrt
|
Loading…
x
Reference in New Issue
Block a user