Skip QWSIF::WindowScreenChanged events if the screen is unchanged

WindowScreenChanged events might be reported repeatedly from the QPA backends
until the event has reached GuiApplicationPrivate::processWindowScreenChangedEvent()
which sets the screen. Ignore events in case the screen is already correct.

Task-number: QTBUG-65580
Task-number: QTBUG-62971
Change-Id: Ie5fc9830771e816db942355efbe5a48e829914cb
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
This commit is contained in:
Friedemann Kleint 2018-01-31 12:24:17 +01:00
parent 2bf4dd1302
commit 120abd19a9

View File

@ -2273,6 +2273,8 @@ void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfa
void QGuiApplicationPrivate::processWindowScreenChangedEvent(QWindowSystemInterfacePrivate::WindowScreenChangedEvent *wse)
{
if (QWindow *window = wse->window.data()) {
if (window->screen() == wse->screen.data())
return;
if (window->isTopLevel()) {
if (QScreen *screen = wse->screen.data())
window->d_func()->setTopLevelScreen(screen, false /* recreate */);