Update for swaywm/wlroots#1126
This commit is contained in:
parent
d4886a3cd5
commit
ecf5b656c9
20
main.c
20
main.c
@ -34,7 +34,7 @@ void sway_terminate(int exit_code) {
|
|||||||
static void daemonize() {
|
static void daemonize() {
|
||||||
int fds[2];
|
int fds[2];
|
||||||
if (pipe(fds) != 0) {
|
if (pipe(fds) != 0) {
|
||||||
wlr_log(L_ERROR, "Failed to pipe");
|
wlr_log(WLR_ERROR, "Failed to pipe");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
if (fork() == 0) {
|
if (fork() == 0) {
|
||||||
@ -58,7 +58,7 @@ static void daemonize() {
|
|||||||
close(fds[1]);
|
close(fds[1]);
|
||||||
uint8_t success;
|
uint8_t success;
|
||||||
if (read(fds[0], &success, 1) != 1 || !success) {
|
if (read(fds[0], &success, 1) != 1 || !success) {
|
||||||
wlr_log(L_ERROR, "Failed to daemonize");
|
wlr_log(WLR_ERROR, "Failed to daemonize");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
close(fds[0]);
|
close(fds[0]);
|
||||||
@ -238,7 +238,7 @@ static void handle_xdg_output_logical_position(void *data,
|
|||||||
|
|
||||||
static void handle_xdg_output_name(void *data, struct zxdg_output_v1 *output,
|
static void handle_xdg_output_name(void *data, struct zxdg_output_v1 *output,
|
||||||
const char *name) {
|
const char *name) {
|
||||||
wlr_log(L_DEBUG, "output name is %s", name);
|
wlr_log(WLR_DEBUG, "output name is %s", name);
|
||||||
struct swaylock_surface *surface = data;
|
struct swaylock_surface *surface = data;
|
||||||
surface->xdg_output = output;
|
surface->xdg_output = output;
|
||||||
surface->output_name = strdup(name);
|
surface->output_name = strdup(name);
|
||||||
@ -354,10 +354,10 @@ static void load_image(char *arg, struct swaylock_state *state) {
|
|||||||
}
|
}
|
||||||
if (exists) {
|
if (exists) {
|
||||||
if (image->output_name) {
|
if (image->output_name) {
|
||||||
wlr_log(L_ERROR, "Multiple images defined for output %s",
|
wlr_log(WLR_ERROR, "Multiple images defined for output %s",
|
||||||
image->output_name);
|
image->output_name);
|
||||||
} else {
|
} else {
|
||||||
wlr_log(L_ERROR, "Multiple default images defined");
|
wlr_log(WLR_ERROR, "Multiple default images defined");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -377,7 +377,7 @@ static void load_image(char *arg, struct swaylock_state *state) {
|
|||||||
}
|
}
|
||||||
wl_list_insert(&state->images, &image->link);
|
wl_list_insert(&state->images, &image->link);
|
||||||
state->args.mode = BACKGROUND_MODE_FILL;
|
state->args.mode = BACKGROUND_MODE_FILL;
|
||||||
wlr_log(L_DEBUG, "Loaded image %s for output %s",
|
wlr_log(WLR_DEBUG, "Loaded image %s for output %s",
|
||||||
image->path, image->output_name ? image->output_name : "*");
|
image->path, image->output_name ? image->output_name : "*");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,7 +416,7 @@ int main(int argc, char **argv) {
|
|||||||
};
|
};
|
||||||
wl_list_init(&state.images);
|
wl_list_init(&state.images);
|
||||||
|
|
||||||
wlr_log_init(L_DEBUG, NULL);
|
wlr_log_init(WLR_DEBUG, NULL);
|
||||||
|
|
||||||
int c;
|
int c;
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -480,13 +480,13 @@ int main(int argc, char **argv) {
|
|||||||
wl_display_roundtrip(state.display);
|
wl_display_roundtrip(state.display);
|
||||||
assert(state.compositor && state.layer_shell && state.shm);
|
assert(state.compositor && state.layer_shell && state.shm);
|
||||||
if (!state.input_inhibit_manager) {
|
if (!state.input_inhibit_manager) {
|
||||||
wlr_log(L_ERROR, "Compositor does not support the input inhibitor "
|
wlr_log(WLR_ERROR, "Compositor does not support the input inhibitor "
|
||||||
"protocol, refusing to run insecurely");
|
"protocol, refusing to run insecurely");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wl_list_empty(&state.surfaces)) {
|
if (wl_list_empty(&state.surfaces)) {
|
||||||
wlr_log(L_DEBUG, "Exiting - no outputs to show on.");
|
wlr_log(WLR_DEBUG, "Exiting - no outputs to show on.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -502,7 +502,7 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
wl_display_roundtrip(state.display);
|
wl_display_roundtrip(state.display);
|
||||||
} else {
|
} else {
|
||||||
wlr_log(L_INFO, "Compositor does not support zxdg output manager, "
|
wlr_log(WLR_INFO, "Compositor does not support zxdg output manager, "
|
||||||
"images assigned to named outputs will not work");
|
"images assigned to named outputs will not work");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,15 +53,15 @@ static bool attempt_password(struct swaylock_password *pw) {
|
|||||||
// TODO: only call pam_start once. keep the same handle the whole time
|
// TODO: only call pam_start once. keep the same handle the whole time
|
||||||
if ((pam_err = pam_start("swaylock", username,
|
if ((pam_err = pam_start("swaylock", username,
|
||||||
&local_conversation, &local_auth_handle)) != PAM_SUCCESS) {
|
&local_conversation, &local_auth_handle)) != PAM_SUCCESS) {
|
||||||
wlr_log(L_ERROR, "PAM returned error %d", pam_err);
|
wlr_log(WLR_ERROR, "PAM returned error %d", pam_err);
|
||||||
}
|
}
|
||||||
if ((pam_err = pam_authenticate(local_auth_handle, 0)) != PAM_SUCCESS) {
|
if ((pam_err = pam_authenticate(local_auth_handle, 0)) != PAM_SUCCESS) {
|
||||||
wlr_log(L_ERROR, "pam_authenticate failed");
|
wlr_log(WLR_ERROR, "pam_authenticate failed");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
// TODO: only call pam_end once we succeed at authing. refresh tokens beforehand
|
// TODO: only call pam_end once we succeed at authing. refresh tokens beforehand
|
||||||
if ((pam_err = pam_end(local_auth_handle, pam_err)) != PAM_SUCCESS) {
|
if ((pam_err = pam_end(local_auth_handle, pam_err)) != PAM_SUCCESS) {
|
||||||
wlr_log(L_ERROR, "pam_end failed");
|
wlr_log(WLR_ERROR, "pam_end failed");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
clear_password_buffer(pw);
|
clear_password_buffer(pw);
|
||||||
|
4
seat.c
4
seat.c
@ -12,13 +12,13 @@ static void keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard,
|
|||||||
struct swaylock_state *state = data;
|
struct swaylock_state *state = data;
|
||||||
if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) {
|
if (format != WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1) {
|
||||||
close(fd);
|
close(fd);
|
||||||
wlr_log(L_ERROR, "Unknown keymap format %d, aborting", format);
|
wlr_log(WLR_ERROR, "Unknown keymap format %d, aborting", format);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
char *map_shm = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
|
char *map_shm = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
|
||||||
if (map_shm == MAP_FAILED) {
|
if (map_shm == MAP_FAILED) {
|
||||||
close(fd);
|
close(fd);
|
||||||
wlr_log(L_ERROR, "Unable to initialize keymap shm, aborting");
|
wlr_log(WLR_ERROR, "Unable to initialize keymap shm, aborting");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
struct xkb_keymap *keymap = xkb_keymap_new_from_string(
|
struct xkb_keymap *keymap = xkb_keymap_new_from_string(
|
||||||
|
Loading…
Reference in New Issue
Block a user