Don't crash if the QWindow's screen is temporarily invalid
It can happen during the transition between screens when one screen is disconnected that the window doesn't have a screen. Task-number: QTBUG-32681 Change-Id: I066855a2ffe80f0680a3044e73f4f491c2c0eb5c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
This commit is contained in:
parent
bf7129af97
commit
488f7a31ff
@ -232,6 +232,10 @@ void QPlatformScreen::setOrientationUpdateMask(Qt::ScreenOrientations mask)
|
|||||||
|
|
||||||
QPlatformScreen * QPlatformScreen::platformScreenForWindow(const QWindow *window)
|
QPlatformScreen * QPlatformScreen::platformScreenForWindow(const QWindow *window)
|
||||||
{
|
{
|
||||||
|
// QTBUG 32681: It can happen during the transition between screens
|
||||||
|
// when one screen is disconnected that the window doesn't have a screen.
|
||||||
|
if (!window->screen())
|
||||||
|
return 0;
|
||||||
return window->screen()->handle();
|
return window->screen()->handle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user