qt5-qtwayland/qtwayland-emit-wl-surfare-lifetime-signals.patch
2019-06-27 15:39:59 +02:00

42 lines
1.2 KiB
Diff

diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index e3785f5..731ed7f 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -210,7 +210,9 @@ void QWaylandWindow::initWindow()
void QWaylandWindow::initializeWlSurface()
{
+ Q_ASSERT(!isInitialized());
init(mDisplay->createSurface(static_cast<QtWayland::wl_surface *>(this)));
+ emit wlSurfaceCreated();
}
bool QWaylandWindow::shouldCreateShellSurface() const
@@ -245,8 +247,10 @@ void QWaylandWindow::reset(bool sendDestroyEvent)
mShellSurface = nullptr;
delete mSubSurfaceWindow;
mSubSurfaceWindow = nullptr;
- if (isInitialized())
+ if (isInitialized()) {
+ emit wlSurfaceDestroyed();
destroy();
+ }
mScreens.clear();
if (mFrameCallback) {
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index c47123d..0e32b59 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -199,6 +199,10 @@ public:
public slots:
void applyConfigure();
+signals:
+ void wlSurfaceCreated();
+ void wlSurfaceDestroyed();
+
protected:
void surface_enter(struct ::wl_output *output) override;
void surface_leave(struct ::wl_output *output) override;