From 0853304bc9e8fa8bca842c5393e5876b7b6507c2 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 9 Aug 2022 21:32:18 +0200 Subject: [PATCH] protocol: add wl_data_device.{enter,leave} Data device focus is currently indicated by wl_keyboard focus. However some systems are lacking keyboards, in which case the wl_seat is missing the keyboard capability and clients can't create a wl_keyboard object. Introduce enter and leave events so that compositors can indicate when a client will receive selection events. Signed-off-by: Simon Ser Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/37 --- protocol/wayland.xml | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/protocol/wayland.xml b/protocol/wayland.xml index 10781cf1..65659103 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -482,7 +482,7 @@ - + A wl_data_offer represents a piece of data offered for transfer by another client (the source client). It is used by the @@ -674,7 +674,7 @@ - + The wl_data_source object is the source side of a wl_data_offer. It is created by the source client in a data transfer and @@ -829,7 +829,7 @@ - + There is one wl_data_device per seat which can be obtained from the global wl_data_device_manager singleton. @@ -963,13 +963,12 @@ data_device.data_offer and the data_offer.offer events are sent out immediately before this event to introduce the data offer object. The selection event is sent to a client - immediately before receiving keyboard focus and when a new - selection is set while the client has keyboard focus. The + immediately before receiving data device focus and when a new + selection is set while the client has data device focus. The data_offer is valid until a new data_offer or NULL is received - or until the client loses keyboard focus. Switching surface with - keyboard focus within the same client doesn't mean a new selection - will be sent. The client must destroy the previous selection - data_offer, if any, upon receiving this event. + or until the client loses data device focus. The client must + destroy the previous selection data_offer, if any, upon receiving + this event. @@ -982,9 +981,33 @@ This request destroys the data device. + + + + + + Notification that this seat's data device has gained focus. + + The compositor must send the wl_data_device.selection event before this + event. + + Before version 4, data device focus was indicated by keyboard focus. + Switching surface with keyboard focus within the same client didn't mean + a new selection event was sent. + + + + + + Notification that this seat's data device has lost focus. + + The client will stop receiving selection events until the next enter + event. + + - + The wl_data_device_manager is a singleton global object that provides access to inter-client data transfer mechanisms such as