diff options
author | Giulio Camuffo <giulio.camuffo@jollamobile.com> | 2014-09-03 23:16:27 +0300 |
---|---|---|
committer | Giulio Camuffo <giulio.camuffo@jollamobile.com> | 2014-09-04 09:55:04 +0200 |
commit | 1e052dd2de91506f71443e50bf225756d5ad69b1 (patch) | |
tree | c0130818c7d5f2ae688c97acef39a2750340e175 /src/client/qwaylanddisplay.cpp | |
parent | a6a288ecce01082de69ec17a0493c859a8e6fde6 (diff) |
Destroy the QScreen when its wl_output is removed
Change-Id: I4532d05cca44c88fe38c14eacbe90c190f272b2c
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/client/qwaylanddisplay.cpp')
-rw-r--r-- | src/client/qwaylanddisplay.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index 595d2ce77..a037bb962 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -262,7 +262,17 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin void QWaylandDisplay::registry_global_remove(uint32_t id) { for (int i = 0, ie = mGlobals.count(); i != ie; ++i) { - if (mGlobals[i].id == id) { + RegistryGlobal &global = mGlobals[i]; + if (global.id == id) { + if (global.interface == QStringLiteral("wl_output")) { + foreach (QWaylandScreen *screen, mScreens) { + if (screen->outputId() == id) { + delete screen; + mScreens.removeOne(screen); + break; + } + } + } mGlobals.removeAt(i); break; } |