File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ struct swaylock_state {
9090 cairo_t * test_cairo ; // used to estimate font/text sizes
9191 enum auth_state auth_state ;
9292 int failed_attempts ;
93- bool run_display ;
93+ bool run_display , locked ;
9494 struct ext_session_lock_manager_v1 * ext_session_lock_manager_v1 ;
9595 struct ext_session_lock_v1 * ext_session_lock_v1 ;
9696};
Original file line number Diff line number Diff line change @@ -313,7 +313,8 @@ struct wl_output_listener _wl_output_listener = {
313313};
314314
315315static void ext_session_lock_v1_handle_locked (void * data , struct ext_session_lock_v1 * lock ) {
316- // Who cares
316+ struct swaylock_state * state = data ;
317+ state -> locked = true;
317318}
318319
319320static void ext_session_lock_v1_handle_finished (void * data , struct ext_session_lock_v1 * lock ) {
@@ -1295,8 +1296,22 @@ int main(int argc, char **argv) {
12951296 create_surface (surface );
12961297 }
12971298
1299+ if (state .ext_session_lock_manager_v1 ) {
1300+ while (!state .locked ) {
1301+ if (wl_display_dispatch (state .display ) < 0 ) {
1302+ swaylock_log (LOG_ERROR , "wl_display_dispatch() failed" );
1303+ return 2 ;
1304+ }
1305+ }
1306+ } else {
1307+ if (wl_display_roundtrip (state .display ) < 0 ) {
1308+ swaylock_log (LOG_ERROR , "wl_display_roundtrip() failed" );
1309+ return 2 ;
1310+ }
1311+ state .locked = true;
1312+ }
1313+
12981314 if (state .args .daemonize ) {
1299- wl_display_roundtrip (state .display );
13001315 daemonize ();
13011316 }
13021317
You can’t perform that action at this time.
0 commit comments