tests/invalid-xdg-shell-actions: Avoid flakyness
The roundtrip in the handle-configure function could in theory (and in practice in the future) happen to receive another configure event. If we send yet another invalid geometry the second time, we log one time too many in the server, which fails the test. Avoid this by ignoring the second configure event; it's enough to pass through the error handling path once. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1993>
This commit is contained in:
parent
4469042e2a
commit
7992b46566
@ -173,10 +173,17 @@ handle_xdg_surface_configure (void *data,
|
|||||||
struct xdg_surface *xdg_surface,
|
struct xdg_surface *xdg_surface,
|
||||||
uint32_t serial)
|
uint32_t serial)
|
||||||
{
|
{
|
||||||
|
static gboolean sent_invalid_once = FALSE;
|
||||||
|
|
||||||
|
if (sent_invalid_once)
|
||||||
|
return;
|
||||||
|
|
||||||
xdg_surface_set_window_geometry (xdg_surface, 0, 0, 0, 0);
|
xdg_surface_set_window_geometry (xdg_surface, 0, 0, 0, 0);
|
||||||
draw_main ();
|
draw_main ();
|
||||||
wl_surface_commit (surface);
|
wl_surface_commit (surface);
|
||||||
|
|
||||||
|
sent_invalid_once = TRUE;
|
||||||
|
|
||||||
g_assert_cmpint (wl_display_roundtrip (display), !=, -1);
|
g_assert_cmpint (wl_display_roundtrip (display), !=, -1);
|
||||||
running = FALSE;
|
running = FALSE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user