Initialize the first wl_surface in the constructor of QWaylandWindow
This makes it possible to get a pointer to a wl_surface immediately after platform window creation. Task-number: QTBUG-58423 Change-Id: I2e62380af8b34d05ae31baacc071766493633022 Reviewed-by: Marco Martin <notmart@gmail.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
This commit is contained in:
parent
efce1fa6e4
commit
b109d2e848
@ -95,6 +95,7 @@ QWaylandWindow::QWaylandWindow(QWindow *window)
|
||||
{
|
||||
static WId id = 1;
|
||||
mWindowId = id++;
|
||||
initializeWlSurface();
|
||||
}
|
||||
|
||||
QWaylandWindow::~QWaylandWindow()
|
||||
@ -127,7 +128,7 @@ void QWaylandWindow::initWindow()
|
||||
return;
|
||||
|
||||
if (!isInitialized())
|
||||
init(mDisplay->createSurface(static_cast<QtWayland::wl_surface *>(this)));
|
||||
initializeWlSurface();
|
||||
|
||||
if (shouldCreateSubSurface()) {
|
||||
Q_ASSERT(!mSubSurfaceWindow);
|
||||
@ -200,6 +201,11 @@ void QWaylandWindow::initWindow()
|
||||
mFlags = window()->flags();
|
||||
}
|
||||
|
||||
void QWaylandWindow::initializeWlSurface()
|
||||
{
|
||||
init(mDisplay->createSurface(static_cast<QtWayland::wl_surface *>(this)));
|
||||
}
|
||||
|
||||
bool QWaylandWindow::shouldCreateShellSurface() const
|
||||
{
|
||||
if (shouldCreateSubSurface())
|
||||
|
@ -248,6 +248,7 @@ private:
|
||||
bool setWindowStateInternal(Qt::WindowState flags);
|
||||
void setGeometry_helper(const QRect &rect);
|
||||
void initWindow();
|
||||
void initializeWlSurface();
|
||||
bool shouldCreateShellSurface() const;
|
||||
bool shouldCreateSubSurface() const;
|
||||
void reset();
|
||||
|
Loading…
x
Reference in New Issue
Block a user