mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-03-23 05:35:51 -04:00
Add wl_fixes.ack_global_remove()
The wl_global_remove() function was introduce to help mitigate clients getting unintentionally disconnected if a global is added and removed in a short burst. The intended usage was: - the compositor calls wl_global_remove() - after a certain period of time, the compositor calls wl_global_destroy() Unfortunately, it did not fully fix the issue due to the way monotonic clock works on Linux. Specifically, it can tick even during sleep. This change adds a slightly better way to handle global removal. With the proposed changes, the clients need to signal to the compositor that they won't bind the global anymore. After all clients have acknowledged a wl_registry.global_remove, the compositor can finally destroy the global. Signed-off-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
This commit is contained in:
parent
bec2bcddd8
commit
268e8373ae
6 changed files with 521 additions and 50 deletions
|
|
@ -3335,12 +3335,20 @@
|
|||
</request>
|
||||
</interface>
|
||||
|
||||
<interface name="wl_fixes" version="1">
|
||||
<interface name="wl_fixes" version="2">
|
||||
<description summary="wayland protocol fixes">
|
||||
This global fixes problems with other core-protocol interfaces that
|
||||
cannot be fixed in these interfaces themselves.
|
||||
</description>
|
||||
|
||||
<enum name="error">
|
||||
<description summary="wl_fixes error values">
|
||||
These errors can be emitted in response to wl_fixes requests.
|
||||
</description>
|
||||
<entry name="invalid_ack_remove" value="0"
|
||||
summary="unknown global or the global is not removed"/>
|
||||
</enum>
|
||||
|
||||
<request name="destroy" type="destructor">
|
||||
<description summary="destroys this object"/>
|
||||
</request>
|
||||
|
|
@ -3360,6 +3368,36 @@
|
|||
<arg name="registry" type="object" interface="wl_registry"
|
||||
summary="the registry to destroy"/>
|
||||
</request>
|
||||
|
||||
<request name="ack_global_remove" since="2">
|
||||
<description summary="acknowledge global removal">
|
||||
Acknowledge the removal of the specified global.
|
||||
|
||||
If no global with the specified name exists or the global is not removed,
|
||||
the wl_fixes.invalid_ack_remove protocol error will be posted.
|
||||
|
||||
Due to the Wayland protocol being asynchronous, the wl_global objects
|
||||
cannot be destroyed immediately. For example, if a wl_global is removed
|
||||
and a client attempts to bind that global around same time, it can
|
||||
result in a protocol error due to an unknown global name in the bind
|
||||
request.
|
||||
|
||||
In order to avoid crashing clients, the compositor should remove the
|
||||
wl_global once it is guaranteed that no more bind requests will come.
|
||||
|
||||
The wl_fixes.ack_global_remove() request is used to signal to the
|
||||
compositor that the client will not bind the given global anymore. After
|
||||
all clients acknowledge the removal of the global, the compositor can
|
||||
safely destroy it.
|
||||
|
||||
The client must call the wl_fixes.ack_global_remove() request in
|
||||
response to a wl_registry.global_remove() event even if it did not bind
|
||||
the corresponding global.
|
||||
</description>
|
||||
<arg name="registry" type="object" interface="wl_registry"
|
||||
summary="the registry object"/>
|
||||
<arg name="name" type="uint" summary="unique name of the global"/>
|
||||
</request>
|
||||
</interface>
|
||||
|
||||
</protocol>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue