summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/client/qwaylandwindow.cpp13
-rw-r--r--src/client/qwaylandwindow_p.h2
2 files changed, 11 insertions, 4 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 9b994508c..5bfa158ae 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -110,7 +110,7 @@ QWaylandWindow::~QWaylandWindow()
delete mWindowDecoration;
if (isInitialized())
- reset();
+ reset(false);
QList<QWaylandInputDevice *> inputDevices = mDisplay->inputDevices();
for (int i = 0; i < inputDevices.size(); ++i)
@@ -132,8 +132,11 @@ void QWaylandWindow::initWindow()
if (window()->type() == Qt::Desktop)
return;
- if (!isInitialized())
+ if (!isInitialized()) {
initializeWlSurface();
+ QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceCreated);
+ QGuiApplication::sendEvent(window(), &e);
+ }
if (shouldCreateSubSurface()) {
Q_ASSERT(!mSubSurfaceWindow);
@@ -240,8 +243,12 @@ bool QWaylandWindow::shouldCreateSubSurface() const
return QPlatformWindow::parent() != Q_NULLPTR;
}
-void QWaylandWindow::reset()
+void QWaylandWindow::reset(bool sendDestroyEvent)
{
+ if (isInitialized() && sendDestroyEvent) {
+ QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed);
+ QGuiApplication::sendEvent(window(), &e);
+ }
delete mShellSurface;
mShellSurface = 0;
delete mSubSurfaceWindow;
diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
index cc11b3c11..9f6ff5b4e 100644
--- a/src/client/qwaylandwindow_p.h
+++ b/src/client/qwaylandwindow_p.h
@@ -252,7 +252,7 @@ private:
void initializeWlSurface();
bool shouldCreateShellSurface() const;
bool shouldCreateSubSurface() const;
- void reset();
+ void reset(bool sendDestroyEvent = true);
void sendExposeEvent(const QRect &rect);
void handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e);