Skip to content

Commit 1a682b9

Browse files
jadahlMarge Bot
authored and
Marge Bot
committed
wayland/xdg-shell: Add support for xdg_toplevel edge constraints
They extend the tiling capabilities of xdg-shell by communicating when a window cannot be resized from a specific edge, e.g. because it's next to a monitor edge. It is roughly equivalent to the gtk_surface1 edge constraint enum. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3266>
1 parent 73626ef commit 1a682b9

File tree

5 files changed

+23
-10
lines changed

5 files changed

+23
-10
lines changed

.gitlab-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ variables:
106106
- .skip-git-clone
107107
variables:
108108
FDO_DISTRIBUTION_VERSION: 42
109-
BASE_TAG: '2025-03-31.0'
109+
BASE_TAG: '2025-04-08.0'
110110
MUTTER_USER: 'meta-user'
111111
FDO_DISTRIBUTION_PACKAGES:
112112
accountsservice-devel

.gitlab-ci/install-common-dependencies.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ then
124124
master
125125
fi
126126

127-
#if ! pkgconf --atleast-version 1.41 wayland-protocols
128-
#then
129-
# ./$SCRIPTS_DIR/install-meson-project.sh \
130-
# "${OPTIONS[@]}" \
131-
# https://gitlab.freedesktop.org/wayland/wayland-protocols.git \
132-
# 1.41
133-
#fi
127+
if ! pkgconf --atleast-version 1.43 wayland-protocols
128+
then
129+
./$SCRIPTS_DIR/install-meson-project.sh \
130+
"${OPTIONS[@]}" \
131+
https://gitlab.freedesktop.org/wayland/wayland-protocols.git \
132+
1.43
133+
fi

meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ gudev_req = '>= 238'
4747

4848
# wayland version requirements
4949
wayland_server_req = '>= 1.23'
50-
wayland_protocols_req = '>= 1.41'
50+
wayland_protocols_req = '>= 1.43'
5151

5252
# native backend version requirements
5353
libinput_req = '>= 1.27.0'

src/wayland/meta-wayland-versions.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/* Global/master objects (version exported by wl_registry and negotiated through bind) */
3535
#define META_WL_COMPOSITOR_VERSION 6
3636
#define META_WL_DATA_DEVICE_MANAGER_VERSION 3
37-
#define META_XDG_WM_BASE_VERSION 6
37+
#define META_XDG_WM_BASE_VERSION 7
3838
#define META_WL_SEAT_VERSION 8
3939
#define META_WL_OUTPUT_VERSION 4
4040
#define META_XSERVER_VERSION 1

src/wayland/meta-wayland-xdg-shell.c

+13
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,19 @@ fill_states (MetaWaylandXdgToplevel *xdg_toplevel,
746746
if (window->edge_constraints.left != META_EDGE_CONSTRAINT_NONE)
747747
add_state_value (states, XDG_TOPLEVEL_STATE_TILED_LEFT);
748748
}
749+
750+
if (wl_resource_get_version (xdg_toplevel->resource) >=
751+
XDG_TOPLEVEL_STATE_CONSTRAINED_LEFT_SINCE_VERSION)
752+
{
753+
if (window->edge_constraints.top == META_EDGE_CONSTRAINT_MONITOR)
754+
add_state_value (states, XDG_TOPLEVEL_STATE_CONSTRAINED_TOP);
755+
if (window->edge_constraints.right == META_EDGE_CONSTRAINT_MONITOR)
756+
add_state_value (states, XDG_TOPLEVEL_STATE_CONSTRAINED_RIGHT);
757+
if (window->edge_constraints.bottom == META_EDGE_CONSTRAINT_MONITOR)
758+
add_state_value (states, XDG_TOPLEVEL_STATE_CONSTRAINED_BOTTOM);
759+
if (window->edge_constraints.left == META_EDGE_CONSTRAINT_MONITOR)
760+
add_state_value (states, XDG_TOPLEVEL_STATE_CONSTRAINED_LEFT);
761+
}
749762
}
750763

751764
static void

0 commit comments

Comments
 (0)