diff options
Diffstat (limited to 'src/wayland/surface.c')
| -rw-r--r-- | src/wayland/surface.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/wayland/surface.c b/src/wayland/surface.c index 4f064e2..f291190 100644 --- a/src/wayland/surface.c +++ b/src/wayland/surface.c @@ -148,13 +148,13 @@ int wayland_display_dispatch_timeout(struct wayland_display *c, int timeout_ms) return -1; } - bool had_pending = display_arm(c); + display_arm(c); if (c->lost) { display_leave(c); return -1; } - if (had_pending && timeout_ms != 0 && display_has_immediate_work(c)) { + if (timeout_ms != 0 && display_has_immediate_work(c)) { timeout_ms = 0; } @@ -177,14 +177,6 @@ int wayland_display_dispatch_timeout(struct wayland_display *c, int timeout_ms) return n; } -void wayland_display_dispatch(struct wayland_display *c) -{ - if (unlikely(!c || c->lost)) - return; - int timeout = (display_has_immediate_work(c) || yasl_loop_is_running(c->loop)) ? 0 : -1; - wayland_display_dispatch_timeout(c, timeout); -} - void wayland_display_flush(struct wayland_display *c) { if (!c || c->lost) @@ -342,8 +334,9 @@ static bool spec_valid(const struct yasl_surface_spec *spec) } struct wayland_surface *wayland_surface_create_toplevel(struct wayland_display *c, - const struct yasl_surface_spec *spec) + const struct yasl_surface_spec *spec, void *graphics_device) { + (void)graphics_device; if (!c || c->lost || !spec_valid(spec)) return NULL; int width = spec->size.x, height = spec->size.y; @@ -457,14 +450,12 @@ void wayland_surface_schedule_redraw(struct wayland_surface *w) yasl_loop_kick(w->conn->loop); } -struct yasl_vector2i wayland_surface_size(const struct wayland_surface *w) +struct yasl_geometry wayland_surface_geometry(const struct wayland_surface *w) { - return w ? (struct yasl_vector2i){ .x = w->width, .y = w->height } : (struct yasl_vector2i){0}; -} - -uint32_t wayland_surface_scale_120(const struct wayland_surface *w) -{ - return w ? w->scale_120 : YASL_SCALE_UNIT; + return (struct yasl_geometry){ + .size = w ? (struct yasl_vector2i){w->width, w->height} : (struct yasl_vector2i){0}, + .scale_120 = w ? w->scale_120 : YASL_SCALE_UNIT, + }; } void wayland_surface_set_background_color(struct wayland_surface *w, uint32_t bg) |
