xdg-shell: Add edge constraints

An edge constraint is an complementery state to the tiled state, meaning
that it's not only tiled, but constrained in a way that it can't resize
in that direction.

This typically means that the constrained edge is tiled against a
monitor edge. An example configuration is two windows tiled next to each
other on a single monitor. Together they cover the whole work area.

The left window would have the following tiled and edge constraint
state:

  [ tiled_top, tiled_right, tiled_bottom, tiled_left,
    constrained_top, constrained_bottom, constrained_left ]

while the right window would have the following:

  [ tiled_top, tiled_right, tiled_bottom, tiled_left,
    constrained_top, constrained_bottom, constrained_right ]

This aims to replace and deprecate the `gtk_surface1.configure_edges`
event and the `gtk_surface1.edge_constraint` enum.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
Jonas Ådahl 2023-07-06 12:15:54 +02:00 committed by Vlad Zahorodnii
parent 00a5b23bfe
commit 86750c99ed

View file

@ -29,7 +29,7 @@
DEALINGS IN THE SOFTWARE.
</copyright>
<interface name="xdg_wm_base" version="6">
<interface name="xdg_wm_base" version="7">
<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
@ -122,7 +122,7 @@
</event>
</interface>
<interface name="xdg_positioner" version="6">
<interface name="xdg_positioner" version="7">
<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
@ -407,7 +407,7 @@
</request>
</interface>
<interface name="xdg_surface" version="6">
<interface name="xdg_surface" version="7">
<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.
@ -617,7 +617,7 @@
</interface>
<interface name="xdg_toplevel" version="6">
<interface name="xdg_toplevel" version="7">
<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,
@ -911,6 +911,38 @@
outputs are switched off due to screen locking.
</description>
</entry>
<entry name="constrained_left" value="10" since="7">
<description summary="the surfaces left edge is constrained">
The left edge of the window is currently constrained, meaning it
shouldn't attempt to resize from that edge. It can for example mean
it's tiled next to a monitor edge on the constrained side of the
window.
</description>
</entry>
<entry name="constrained_right" value="11" since="7">
<description summary="the surfaces right edge is constrained">
The right edge of the window is currently constrained, meaning it
shouldn't attempt to resize from that edge. It can for example mean
it's tiled next to a monitor edge on the constrained side of the
window.
</description>
</entry>
<entry name="constrained_top" value="12" since="7">
<description summary="the surfaces top edge is constrained">
The top edge of the window is currently constrained, meaning it
shouldn't attempt to resize from that edge. It can for example mean
it's tiled next to a monitor edge on the constrained side of the
window.
</description>
</entry>
<entry name="constrained_bottom" value="13" since="7">
<description summary="the surfaces bottom edge is tiled">
The bottom edge of the window is currently constrained, meaning it
shouldn't attempt to resize from that edge. It can for example mean
it's tiled next to a monitor edge on the constrained side of the
window.
</description>
</entry>
</enum>
<request name="set_max_size">
@ -1207,7 +1239,7 @@
</event>
</interface>
<interface name="xdg_popup" version="6">
<interface name="xdg_popup" version="7">
<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