xcb: another QXcbScreen null pointer check

In QXcbWindow::setParent(), the window may not have a screen,
and in that case we cannot get the root window in this way.

Task-number: QTBUG-44719
Change-Id: I719e5e2f8cad13b1460b4d9df6ffd6c4a48e0d37
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
bb10
Shawn Rutledge 2015-03-10 14:51:19 +01:00
parent cacae82a70
commit 37b7c5164c
1 changed files with 2 additions and 0 deletions

View File

@ -1371,6 +1371,8 @@ void QXcbWindow::setParent(const QPlatformWindow *parent)
xcb_parent_id = qXcbParent->xcb_window();
m_embedded = qXcbParent->window()->type() == Qt::ForeignWindow;
} else {
if (!xcbScreen())
return;
xcb_parent_id = xcbScreen()->root();
m_embedded = false;
}