summaryrefslogtreecommitdiff
path: root/password.c
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2018-06-08 21:59:18 +0900
committerDominique Martinet <asmadeus@codewreck.org>2018-07-07 21:02:28 +0900
commit01d2c492fda93971d4a13ce05abac3a254fef314 (patch)
tree52279ad3598dbbf7700b9f7e2e39776fc73a65d1 /password.c
parent1468d893953d099b7dcf1fa7a83ac79a8d8891e3 (diff)
swaylock: fix the displaying of "verified"
Displaying verified after damaging state needs more than one roundtrip, so keep looping until surfaces are not dirty anymore
Diffstat (limited to 'password.c')
-rw-r--r--password.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/password.c b/password.c
index bb32286..d844ec9 100644
--- a/password.c
+++ b/password.c
@@ -97,7 +97,20 @@ void swaylock_handle_key(struct swaylock_state *state,
case XKB_KEY_Return:
state->auth_state = AUTH_STATE_VALIDATING;
damage_state(state);
- wl_display_roundtrip(state->display);
+ while (wl_display_dispatch(state->display) != -1 && state->run_display) {
+ bool ok = 1;
+ struct swaylock_surface *surface;
+ wl_list_for_each(surface, &state->surfaces, link) {
+ if (surface->dirty) {
+ ok = 0;
+ }
+ }
+ if (ok) {
+ break;
+ }
+ }
+ wl_display_flush(state->display);
+
if (attempt_password(&state->password)) {
state->run_display = false;
break;