From f277e6540b4183010b859f9e8e91941c14cf592f Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Wed, 14 Oct 2026 14:22:39 +0300 Subject: Require presses in X11 and integration tests Integration tests now expect ESTALE from move, resize, window menu, drag and popups when nothing presses a button, and the X11 input test expects the same from the window menu and move. Resolving the previous commit's merge also made the direct SHM path check the window's own visual (possibly 32-bit ARGB) and dropped the held-button check from place_under_pointer, which yasl.h never asked for. Co-Authored-By: Claude Opus 5.5 --- tests/common/test_surface_integration.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tests/common') diff --git a/tests/common/test_surface_integration.c b/tests/common/test_surface_integration.c index 887f254..1dca7c8 100644 --- a/tests/common/test_surface_integration.c +++ b/tests/common/test_surface_integration.c @@ -274,10 +274,12 @@ int main(int argc, char **argv) assert(double_click >= 1 && double_click <= 10000); assert(yasl_drag_cancel() == 0); - /* Without a pointer press these may fail with an errno; they must simply return. */ - assert(yasl_surface_begin_move_resize(s, 0) <= 0); - assert(yasl_surface_show_window_menu(s, 1, 1) <= 0); - assert(yasl_drag_start(s, NULL) <= 0); + /* Nothing presses a button here, so calls that need a press report ESTALE. */ + int no_press[] = {yasl_surface_begin_move_resize(s, 0), + yasl_surface_begin_move_resize(s, YASL_EDGE_BOTTOM | YASL_EDGE_RIGHT), + yasl_surface_show_window_menu(s, 1, 1), yasl_drag_start(s, NULL)}; + for (size_t i = 0; i < sizeof(no_press) / sizeof(no_press[0]); i++) + assert(no_press[i] == -ESTALE || no_press[i] == -ENOTSUP); drain(); /* A popup needs an input grab to open; if it opens, its parent owns it. */ @@ -288,7 +290,7 @@ int main(int argc, char **argv) yasl_surface *popup = yasl_popup_create(s, &popup_options); uintptr_t popup_id = (uintptr_t)popup; if (!popup) { - assert(errno != 0); + assert(errno == ESTALE); } else { assert(listed(display, popup_id)); assert(yasl_popup_reposition(popup, &popup_options) <= 0); -- cgit v1.2.3