Dereference of the parent argument did not check for nullptr. For
example, the hellogl example would crash. Now if the parent
argument is null, the screen's root window is used.
Change-Id: Ib06181c9ab9794d577722f1c1dd5ee92e4edaee5
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
return x_window;
}
-void QXlibWindow::setParent(const QPlatformWindow *window)
+void QXlibWindow::setParent(const QPlatformWindow *parent)
{
QPoint topLeft = geometry().topLeft();
- XReparentWindow(mScreen->display()->nativeDisplay(),x_window,window->winId(),topLeft.x(),topLeft.y());
+ WId parentWinId = parent ? parent->winId() : mScreen->rootWindow();
+ XReparentWindow(mScreen->display()->nativeDisplay(),x_window,parentWinId,topLeft.x(),topLeft.y());
}
void QXlibWindow::raise()
void setVisible(bool visible);
WId winId() const;
- void setParent(const QPlatformWindow *window);
+ void setParent(const QPlatformWindow *parent);
void raise();
void lower();
void setWindowTitle(const QString &title);