aboutsummaryrefslogtreecommitdiff
path: root/swaylock/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'swaylock/main.c')
-rw-r--r--swaylock/main.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/swaylock/main.c b/swaylock/main.c
index 668a8742..ed8c5607 100644
--- a/swaylock/main.c
+++ b/swaylock/main.c
@@ -32,7 +32,7 @@ void sway_terminate(int exit_code) {
exit(exit_code);
}
-static void daemonize() {
+static void daemonize(void) {
int fds[2];
if (pipe(fds) != 0) {
wlr_log(WLR_ERROR, "Failed to pipe");
@@ -195,11 +195,15 @@ void damage_state(struct swaylock_state *state) {
}
}
-static void handle_wl_output_geometry(void *data, struct wl_output *output,
+static void handle_wl_output_geometry(void *data, struct wl_output *wl_output,
int32_t x, int32_t y, int32_t width_mm, int32_t height_mm,
int32_t subpixel, const char *make, const char *model,
int32_t transform) {
- // Who cares
+ struct swaylock_surface *surface = data;
+ surface->subpixel = subpixel;
+ if (surface->state->run_display) {
+ damage_surface(surface);
+ }
}
static void handle_wl_output_mode(void *data, struct wl_output *output,
@@ -841,6 +845,9 @@ static int load_config(char *path, struct swaylock_state *state,
static struct swaylock_state state;
int main(int argc, char **argv) {
+ wlr_log_init(WLR_DEBUG, NULL);
+ initialize_pw_backend();
+
enum line_mode line_mode = LM_LINE;
state.args = (struct swaylock_args){
.mode = BACKGROUND_MODE_SOLID_COLOR,
@@ -853,8 +860,6 @@ int main(int argc, char **argv) {
wl_list_init(&state.images);
set_default_colors(&state.args.colors);
- wlr_log_init(WLR_DEBUG, NULL);
-
char *config_path = NULL;
int result = parse_options(argc, argv, NULL, NULL, &config_path);
if (result != 0) {