From 98f0d51157fa2a2b8ccaae54ed4850a88d223d01 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 15:05:06 +0300 Subject: Simplify surface state, examples, and library installation --- src/platform/wayland/buffer.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/platform/wayland/buffer.c') diff --git a/src/platform/wayland/buffer.c b/src/platform/wayland/buffer.c index f4243d1..f5a2c0f 100644 --- a/src/platform/wayland/buffer.c +++ b/src/platform/wayland/buffer.c @@ -1,4 +1,6 @@ #include "internal.h" +#include "common/utf8.h" +#include #include static long minor_faults(void) @@ -134,7 +136,8 @@ int apply_pending_geometry(struct wayland_surface *w) w->size_pending = false; return 0; } - bool floating = !w->parent && !w->maximized && !w->fullscreen && !w->tiled; + bool floating = !w->parent && !(w->base.state & + (YASL_STATE_MAXIMIZED | YASL_STATE_FULLSCREEN | YASL_STATE_TILED)); int free_w = floating && w->floating_width > 0 ? w->floating_width : w->logical_width; int free_h = floating && w->floating_height > 0 ? w->floating_height : w->logical_height; int logical_w = !w->parent && w->req_width > 0 ? w->req_width : free_w; @@ -143,7 +146,7 @@ int apply_pending_geometry(struct wayland_surface *w) if (logical_w < YASL_MIN_LOGICAL_PX) logical_w = YASL_MIN_LOGICAL_PX; if (logical_h < YASL_MIN_LOGICAL_PX) logical_h = YASL_MIN_LOGICAL_PX; } - if (!w->fullscreen) { + if (!(w->base.state & YASL_STATE_FULLSCREEN)) { if (w->bound_width > 0 && logical_w > w->bound_width) logical_w = w->bound_width; if (w->bound_height > 0 && logical_h > w->bound_height) @@ -539,16 +542,6 @@ void wayland_surface_set_title(struct wayland_surface *w, const char *title) free(copy); } -uint32_t wayland_surface_state(const struct wayland_surface *w) -{ - if (unlikely(!w)) return 0; - return ((uint32_t)w->fullscreen * YASL_STATE_FULLSCREEN) | - ((uint32_t)w->maximized * YASL_STATE_MAXIMIZED) | - ((uint32_t)w->activated * YASL_STATE_ACTIVATED) | - ((uint32_t)w->suspended * YASL_STATE_SUSPENDED) | - ((uint32_t)!w->server_decorated * YASL_STATE_CSD); -} - struct yasl_timing wayland_surface_timing(const struct wayland_surface *w) { struct yasl_timing t = { -- cgit v1.2.3