mirror of
https://github.com/swaywm/sway.git
synced 2026-05-05 06:46:49 -04:00
Be more agressive grabbing inhibit lock
This commit is contained in:
parent
3e2af9c4a2
commit
72054eba22
1 changed files with 1 additions and 3 deletions
|
|
@ -92,15 +92,13 @@ static int check_for_lock(void *data) {
|
|||
static void prepare_for_sleep(struct wlr_session *session, void *data) {
|
||||
struct sway_server *server = data;
|
||||
wlr_log(L_INFO, "PrepareForSleep signal received");
|
||||
fd = wlr_session_inhibit_sleep(session);
|
||||
if(have_lock()) { //If we for some reason already have a lockscreen
|
||||
wlr_log(L_INFO, "Already have lock, no inhibit");
|
||||
cleanup_inhibit();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
wlr_log(L_DEBUG, "Trying to inhibit sleep");
|
||||
fd = wlr_session_inhibit_sleep(session);
|
||||
invoke_swaylock();
|
||||
if (fd>=0) {
|
||||
struct wl_event_source *source = wl_event_loop_add_timer(server->wl_event_loop, check_for_lock, server);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue