From 3b8af02be94a510e385f44d58c35c86bb89424a6 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Mon, 12 Oct 2026 08:41:51 +0300 Subject: refactor: simplify public API and isolate native extensions Separate loop/timer and native interoperability APIs from the portable surface header. Unify dispatch, geometry queries, and timer callbacks; keep framebuffer bookkeeping and frame clocks private, and hide implementation symbols. Update backends, documentation, examples, and API/integration coverage. Verify exports, strict C/C++ installed consumers, and normal plus ASan/UBSan suites. --- tests/wayland/test_input.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'tests/wayland/test_input.c') diff --git a/tests/wayland/test_input.c b/tests/wayland/test_input.c index f421e6c..7b91a9d 100644 --- a/tests/wayland/test_input.c +++ b/tests/wayland/test_input.c @@ -1,8 +1,33 @@ #include "wayland/internal.h" #include +static void test_popup_bounds(void) +{ + struct seat seat = {.input_serial = 1}; + struct wayland_display d = {.base.ops = &yasl_wayland_backend, .seats = &seat}; + struct wayland_surface w = {.base.display = &d.base, .conn = &d}; + w.parent = &w; + w.content.x = w.content.y = 1; + /* Invalid bounds must be rejected before accessing any protocol object. */ + w.xdg_surface = (struct xdg_surface *)&w; + w.popup = (struct xdg_popup *)&w; + struct yasl_popup_spec specs[] = { + {.size = {100, 100}, .content_offset = {INT_MAX, 0}, .content_size = {1, 0}}, + {.size = {100, 100}, .content_offset = {0, INT_MAX}, .content_size = {0, 1}}, + {.size = {100, 100}, .content_offset = {1, 0}, .content_size = {INT_MAX, 0}}, + {.size = {100, 100}, .content_offset = {0, 1}, .content_size = {0, INT_MAX}}, + {.size = {100, 100}, .anchor = {INT_MIN, 0, 1, 1}}, + {.size = {100, 100}, .anchor = {0, INT_MIN, 1, 1}}, + }; + for (size_t i = 0; i < sizeof(specs) / sizeof(specs[0]); i++) { + assert(!yasl_surface_create_popup(&w.base, &specs[i])); + assert(!yasl_surface_popup_reposition(&w.base, &specs[i])); + } +} + int main(void) { + test_popup_bounds(); struct wayland_surface w = {0}; struct seat seat = {.ime_focus = &w}; wayland_surface_set_callbacks(&w, NULL, NULL); -- cgit v1.2.3