aboutsummaryrefslogtreecommitdiff
path: root/wayland.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-04-07 11:32:30 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-04-07 11:41:37 +0000
commit23431e3ecfb59f71627b332852b906dc3d0bfad7 (patch)
treeb16481d12c1546fc912cc7b233e8a18e044e30b4 /wayland.h
parentwayland: handle xdg-shell edge constraints (diff)
wayland+input: add support for toplevel edge constraints
Edge constraints are new (not yet available in a wayland-protocols release) toplevel states, acting as a complement to the existing tiled states. Tiled tells us we shouldn't draw shadows etc *outside our window geometry*. Constrained tells us the window cannot be resized in the constrained direction. This patch does a couple of things: * Recognize the new states when debug logging * Change is_top_left() etc to look at the new constrained state instead of the tiled state. These functions are used when both choosing cursor shape, and when determining if/how to resize a window on a CSD edge click-and-drag. * Update cursor shape selection to use the default (left_ptr) shape when on a constrained edge (or corner). * Update CSD resize triggering, to not trigger a resize when attempted on a constrained edge (or corner). See https://gitlab.freedesktop.org/wayland/wayland-protocols/-/commit/86750c99ed062c306e837f11bb9492df572ad677: 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.
Diffstat (limited to 'wayland.h')
-rw-r--r--wayland.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/wayland.h b/wayland.h
index 37dd7860..a9d6858c 100644
--- a/wayland.h
+++ b/wayland.h
@@ -402,6 +402,12 @@ struct wl_window {
bool is_tiled_left;
bool is_tiled_right;
bool is_tiled; /* At least one of is_tiled_{top,bottom,left,right} is true */
+
+ bool is_constrained_top;
+ bool is_constrained_bottom;
+ bool is_constrained_left;
+ bool is_constrained_right;
+
struct {
int width;
int height;
@@ -409,10 +415,17 @@ struct wl_window {
bool is_fullscreen:1;
bool is_maximized:1;
bool is_resizing:1;
+
bool is_tiled_top:1;
bool is_tiled_bottom:1;
bool is_tiled_left:1;
bool is_tiled_right:1;
+
+ bool is_constrained_top:1;
+ bool is_constrained_bottom:1;
+ bool is_constrained_left:1;
+ bool is_constrained_right:1;
+
enum csd_mode csd_mode;
} configure;