summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2020-01-13 19:05:24 +0100
committerJonas Ådahl <jadahl@gmail.com>2020-02-29 15:34:42 +0100
commitebbad29e3fc82f62a73cc19e924dcde89dd05c49 (patch)
treee4a46ab70970350715ea07c05f4c6ac2fe8aa135
parent2b0c87ea5eb906268f93ab6989c69a62e42f20e4 (diff)
downloadwayland-protocols-ebbad29e3fc82f62a73cc19e924dcde89dd05c49.tar.gz
xdg-shell: Add support for implicit popup repositioning
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 <jadahl@gmail.com> Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Simon Ser <contact@emersion.fr>
-rw-r--r--stable/xdg-shell/xdg-shell.xml29
1 files changed, 24 insertions, 5 deletions
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.
</copyright>
- <interface name="xdg_wm_base" version="2">
+ <interface name="xdg_wm_base" version="3">
<description summary="create desktop-style surfaces">
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 @@
</event>
</interface>
- <interface name="xdg_positioner" version="2">
+ <interface name="xdg_positioner" version="3">
<description summary="child surface positioner">
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 @@
<arg name="x" type="int" summary="surface position x offset"/>
<arg name="y" type="int" summary="surface position y offset"/>
</request>
+
+ <!-- Version 3 additions -->
+
+ <request name="set_reactive" since="3">
+ <description summary="continuously reconstrain the surface">
+ 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.
+ </description>
+ </request>
</interface>
- <interface name="xdg_surface" version="2">
+ <interface name="xdg_surface" version="3">
<description summary="desktop user interface surface base interface">
An interface that may be implemented by a wl_surface, for
implementations that provide a desktop-style user interface.
@@ -526,9 +539,10 @@
</description>
<arg name="serial" type="uint" summary="serial of the configure event"/>
</event>
+
</interface>
- <interface name="xdg_toplevel" version="2">
+ <interface name="xdg_toplevel" version="3">
<description summary="toplevel surface">
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 @@
</event>
</interface>
- <interface name="xdg_popup" version="2">
+ <interface name="xdg_popup" version="3">
<description summary="short-lived, popup surfaces for menus">
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.
</description>
<arg name="x" type="int"
summary="x position relative to parent surface window geometry"/>