summaryrefslogtreecommitdiff
path: root/src/platform/wayland/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/wayland/buffer.c')
-rw-r--r--src/platform/wayland/buffer.c17
1 files changed, 5 insertions, 12 deletions
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 <errno.h>
#include <sys/resource.h>
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 = {