mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-07 13:08:04 +02:00
keyboard-test: Use wl_display_roundtrip() instead of yield()
As for button-test, a wl_display_roundtrip is sufficient here. The yield() between wl_test_activate_surface() and wl_test_send_key() is also not needed, since the two requests will arrive at the server in order, and will activate the surface first, then send a key event.
This commit is contained in:
parent
a1ada26c2b
commit
d001ebc77b
1 changed files with 2 additions and 4 deletions
|
|
@ -44,24 +44,22 @@ TEST(simple_keyboard_test)
|
|||
expect_state = WL_KEYBOARD_KEY_STATE_RELEASED;
|
||||
wl_test_send_key(client->test->wl_test, expect_key,
|
||||
expect_state);
|
||||
yield(client);
|
||||
} else if (keyboard->focus) {
|
||||
expect_focus = NULL;
|
||||
wl_test_activate_surface(client->test->wl_test,
|
||||
NULL);
|
||||
yield(client);
|
||||
} else if (expect_key < 10) {
|
||||
expect_key++;
|
||||
expect_focus = client->surface;
|
||||
expect_state = WL_KEYBOARD_KEY_STATE_PRESSED;
|
||||
wl_test_activate_surface(client->test->wl_test,
|
||||
expect_focus->wl_surface);
|
||||
yield(client);
|
||||
wl_test_send_key(client->test->wl_test, expect_key,
|
||||
expect_state);
|
||||
yield(client);
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
wl_display_roundtrip(client->wl_display);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue