Add wrapper for wl_global_remove

Authored by davidedmundson on Apr 24 2020, 2:45 PM.

Description

Add wrapper for wl_global_remove

Summary:
Removes the Global from the registry, but does not delete the underlying
wl_global

Removal of a global is racey in wayland.
A client could be trying to bind at that moment.

Typically globals are static for the lifespan of the compositor, however
there are exceptions

For those cases this call will can remove the global from the registry,
but still keep the wl_global instance alive
and handling bind requests.

The compositor can then remove the Global wrapper (this object) deleting
the wl_global after an arbitrary delay or
keep it around for re-use for the duration of the compositor.

Test Plan:
Unit test
Made blur global outlive BlurEffect - no longer disconnects plasma on config changes

Reviewers: Plasma, apol

Reviewed By: apol

Subscribers: kde-frameworks-devel

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D28883

meven added inline comments.
/src/server/global.cpp
61

This adds a hard dependency on Wayland 1.18 (https://gitlab.freedesktop.org/wayland/wayland/-/commit/39852f1146941fa93daf767b4ecfb41b2d11aaef) which makes kwayland unable to build in neon that has wayland 1.16.
Next major upgrade of neon should be based on ubuntu 20.04 that has Wayland 1.17, so this won't be sufficient. @jriddell please correct me if I am wrong.

We might add #idef around this in the meantime.

#ifdef would compile, sure, but the whole thing would just be broken.

I'll revert, I haven't landed the patch using it yet.