From ebbad29e3fc82f62a73cc19e924dcde89dd05c49 Mon Sep 17 00:00:00 2001 From: Jonas Ådahl Date: Mon, 13 Jan 2020 19:05:24 +0100 Subject: xdg-shell: Add support for implicit popup repositioning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds protocol additions making it possible to implicitly reposition an already mapped popup if the conditions for the constraint changed (e.g. toplevel moved). Implicit popup moving is done by setting a adjustment flag on the positioner used to create it that will cause the compositor to adjust the position as the conditions used to constrain it change. These changes may include, for example, changes in the position of the parent window or the geometry of the work area. To allow the client to update its content in response to the updated position, the client must ack the configure event, optionally with new content. Until the client acks this configure event, the existing positioner will continue to be used. Implicit repositioning by itself is racy regarding inter-surface synchronization of applied state. Inter-surface synchronization is deliberately left out of xdg-shell, and left to be handled externally. Signed-off-by: Jonas Ådahl Reviewed-by: Mike Blumenkrantz Reviewed-by: Simon Ser --- stable/xdg-shell/xdg-shell.xml | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'stable') diff --git a/stable/xdg-shell/xdg-shell.xml b/stable/xdg-shell/xdg-shell.xml index 10c6d6e..a3ab57b 100644 --- a/stable/xdg-shell/xdg-shell.xml +++ b/stable/xdg-shell/xdg-shell.xml @@ -29,7 +29,7 @@ DEALINGS IN THE SOFTWARE. - + The xdg_wm_base interface is exposed as a global object enabling clients to turn their wl_surfaces into windows in a desktop environment. It @@ -115,7 +115,7 @@ - + The xdg_positioner provides a collection of rules for the placement of a child surface relative to a parent surface. Rules can be defined to ensure @@ -357,9 +357,22 @@ + + + + + + When set reactive, the surface is reconstrained if the conditions used + for constraining changed, e.g. the parent window moved. + + If the conditions changed and the popup was reconstrained, an + xdg_popup.configure event is sent with updated geometry, followed by an + xdg_surface.configure event. + + - + An interface that may be implemented by a wl_surface, for implementations that provide a desktop-style user interface. @@ -526,9 +539,10 @@ + - + This interface defines an xdg_surface role which allows a surface to, among other things, set window-like properties such as maximize, @@ -1019,7 +1033,7 @@ - + A popup surface is a short-lived, temporary surface. It can be used to implement for example menus, popovers, tooltips and other similar user @@ -1120,6 +1134,11 @@ The x and y arguments represent the position the popup was placed at given the xdg_positioner rule, relative to the upper left corner of the window geometry of the parent surface. + + For version 2 or older, the configure event for an xdg_popup is only + ever sent once for the initial configuration. Starting with version 3, + it may be sent again if the popup is setup with an xdg_positioner with + set_reactive requested. -- cgit v1.2.3