From 120abd19a915b2cadd3591f06794bc64ebcd80a4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 31 Jan 2018 12:24:17 +0100 Subject: Skip QWSIF::WindowScreenChanged events if the screen is unchanged MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/gui/kernel/qguiapplication.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 3d85f47f34..5f4a1a0236 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -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 */); -- cgit v1.2.3