summaryrefslogtreecommitdiff
path: root/swaylock
diff options
context:
space:
mode:
authorFurkan Sahin <furkan-dev@proton.me>2018-06-08 21:59:18 +0900
committerFurkan Sahin <furkan-dev@proton.me>2018-06-08 21:59:18 +0900
commit5d015612df95f32d4e9c32b6bf9f77eaa0bab6e0 (patch)
treeef55a4d90cd33a4ad59130f61d93169c3b852b5b /swaylock
parentc3f654413a10962e53dc9ac39fd9e76c51ea6312 (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 'swaylock')
-rw-r--r--swaylock/password.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/swaylock/password.c b/swaylock/password.c
index bb32286e..d844ec98 100644
--- a/swaylock/password.c
+++ b/swaylock/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;