diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2017-02-01 15:25:13 +0100 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2017-02-22 11:18:32 +0000 |
commit | 7d527c1914710a511c06713bbda1572b767cea34 (patch) | |
tree | 89a4fcf8300ee00f8f1386337c7eff0cd7017a74 /src/client/qwaylandwindow.cpp | |
parent | ca27d9021f60175932626e7511cc1e7f0545f6e6 (diff) |
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>
Diffstat (limited to 'src/client/qwaylandwindow.cpp')
-rw-r--r-- | src/client/qwaylandwindow.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 58848096a..83e5f7c7a 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -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()) |