Fix use of removed functions in comm_in

This commit is contained in:
pjht 2024-11-09 10:33:45 -06:00
parent bb9eae49c2
commit 9b164de0cf
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E
26 changed files with 18 additions and 6 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -141,6 +141,7 @@ void render(struct swaylock_surface *surface);
void damage_state(struct swaylock_state *state);
void clear_password_buffer(struct swaylock_password *pw);
void schedule_auth_idle(struct swaylock_state *state);
void schedule_auth_idle_msg(struct swaylock_state *state);
void initialize_pw_backend(int argc, char **argv);
void run_pw_backend_child(void);

8
main.c
View File

@ -1049,18 +1049,14 @@ static void comm_in(int fd, short mask, void *data) {
damage_state(&state);
} else if (reply.kind == REPLY_CONTINUE) {
state.auth_state = AUTH_STATE_IDLE;
schedule_indicator_clear(&state);
schedule_auth_idle(&state);
damage_state(&state);
} else if (reply.kind == REPLY_MSG) {
state.auth_state = AUTH_STATE_IDLE_MSG;
memcpy(&state.pam_msg[0], &reply.pam_msg[0], 256);
schedule_indicator_clear(&state);
schedule_auth_idle_msg(&state);
damage_state(&state);
}
struct swaylock_surface *surface;
wl_list_for_each(surface, &state.surfaces, link) {
render_frame(surface);
}
}
static void term_in(int fd, short mask, void *data) {

View File

@ -60,6 +60,13 @@ static void set_auth_idle(void *data) {
damage_state(state);
}
static void set_auth_idle_msg(void *data) {
struct swaylock_state *state = data;
state->auth_idle_timer = NULL;
state->auth_state = AUTH_STATE_IDLE_MSG;
damage_state(state);
}
static void schedule_input_idle(struct swaylock_state *state) {
if (state->input_idle_timer) {
loop_remove_timer(state->eventloop, state->input_idle_timer);
@ -83,6 +90,14 @@ void schedule_auth_idle(struct swaylock_state *state) {
state->eventloop, 3000, set_auth_idle, state);
}
void schedule_auth_idle_msg(struct swaylock_state *state) {
if (state->auth_idle_timer) {
loop_remove_timer(state->eventloop, state->auth_idle_timer);
}
state->auth_idle_timer = loop_add_timer(
state->eventloop, 3000, set_auth_idle_msg, state);
}
static void clear_password(void *data) {
struct swaylock_state *state = data;
state->clear_password_timer = NULL;