diff options
author | David Redondo <qt@david-redondo.de> | 2022-01-24 11:46:07 +0100 |
---|---|---|
committer | David Redondo <qt@david-redondo.de> | 2022-03-09 15:30:01 +0100 |
commit | cdf85f33df601e6a2d1972977c92c9bc33a0e967 (patch) | |
tree | b5f3408af4cad3e37f7fb1a5cf50afda0a207d8f /src/client/qwaylanddisplay.cpp | |
parent | 97b5ebb4d0ccc47805e685090c48fd514292252f (diff) |
Add globalRemove to QWaylandClientExtension
Adds support for handling of removal of the relevant global to
QtWaylandClientExtension. The user is responsible for destroying the object
once it becomes inactive to match the behavior on destruction.
Two signals for globals and their removal are added to QWaylandDisplay
to make it a bit nicer to use in a more "Qt-way". The addRregistryListener
function is kept for now until other places are ported.
Change-Id: I4ccbaa32e18a5ae15871aa23639e2b4a372cc34e
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'src/client/qwaylanddisplay.cpp')
-rw-r--r-- | src/client/qwaylanddisplay.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp index f8cb75e95..79c68a932 100644 --- a/src/client/qwaylanddisplay.cpp +++ b/src/client/qwaylanddisplay.cpp @@ -634,6 +634,7 @@ void QWaylandDisplay::registry_global(uint32_t id, const QString &interface, uin } mGlobals.append(RegistryGlobal(id, interface, version, registry)); + emit globalAdded(mGlobals.back()); const auto copy = mRegistryListeners; // be prepared for listeners unregistering on notification for (Listener l : copy) @@ -690,7 +691,7 @@ void QWaylandDisplay::registry_global_remove(uint32_t id) inputDevice->setTextInputMethod(nullptr); mWaylandIntegration->reconfigureInputContext(); } - mGlobals.removeAt(i); + emit globalRemoved(mGlobals.takeAt(i)); break; } } |