summaryrefslogtreecommitdiff
path: root/tests/wayland/test_input.c
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-12 08:41:51 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-12 08:41:51 +0300
commit3b8af02be94a510e385f44d58c35c86bb89424a6 (patch)
tree2573fb5ac41700d458109ee1cea4bfd875ecf1a2 /tests/wayland/test_input.c
parentf7fa0930cb46046f995fa1ab927aef62466e995e (diff)
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.
Diffstat (limited to 'tests/wayland/test_input.c')
-rw-r--r--tests/wayland/test_input.c25
1 files changed, 25 insertions, 0 deletions
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 <assert.h>
+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);