diff options
author | Błażej Szczygieł <spaz16@wp.pl> | 2016-01-05 00:05:21 +0100 |
---|---|---|
committer | Błażej Szczygieł <spaz16@wp.pl> | 2016-01-07 11:02:35 +0000 |
commit | 7409e3a42bcfdf4d170832efa076a5795423c1d6 (patch) | |
tree | b4b82506a96cbd763f166afb72ead6f2bb6f4d39 /src/gui/kernel | |
parent | 7e28079484ec12ce0609419262b869354e7678a7 (diff) |
QtGui: Don't set screen to a child window when processing screen events
Setting a screen to a child window causes a warning message. This patch
prevents the debug message by catching incorrect behavior made by QPA
earlier.
Change-Id: Idf3ac02290a18afc134f19c2b91348dc009ca4ca
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 00e3e2fcf4..770f847190 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2090,10 +2090,12 @@ void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfa void QGuiApplicationPrivate::processWindowScreenChangedEvent(QWindowSystemInterfacePrivate::WindowScreenChangedEvent *wse) { if (QWindow *window = wse->window.data()) { - if (QScreen *screen = wse->screen.data()) - window->d_func()->setTopLevelScreen(screen, false /* recreate */); - else // Fall back to default behavior, and try to find some appropriate screen - window->setScreen(0); + if (window->isTopLevel()) { + if (QScreen *screen = wse->screen.data()) + window->d_func()->setTopLevelScreen(screen, false /* recreate */); + else // Fall back to default behavior, and try to find some appropriate screen + window->setScreen(0); + } // we may have changed scaling, so trigger resize event if needed if (window->handle()) { QWindowSystemInterfacePrivate::GeometryChangeEvent gce(window, QHighDpi::fromNativePixels(window->handle()->geometry(), window), QRect()); |