diff options
Diffstat (limited to 'swaylock/main.c')
-rw-r--r-- | swaylock/main.c | 15 |
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) { | |||
32 | exit(exit_code); | 32 | exit(exit_code); |
33 | } | 33 | } |
34 | 34 | ||
35 | static void daemonize() { | 35 | static void daemonize(void) { |
36 | int fds[2]; | 36 | int fds[2]; |
37 | if (pipe(fds) != 0) { | 37 | if (pipe(fds) != 0) { |
38 | wlr_log(WLR_ERROR, "Failed to pipe"); | 38 | wlr_log(WLR_ERROR, "Failed to pipe"); |
@@ -195,11 +195,15 @@ void damage_state(struct swaylock_state *state) { | |||
195 | } | 195 | } |
196 | } | 196 | } |
197 | 197 | ||
198 | static void handle_wl_output_geometry(void *data, struct wl_output *output, | 198 | static void handle_wl_output_geometry(void *data, struct wl_output *wl_output, |
199 | int32_t x, int32_t y, int32_t width_mm, int32_t height_mm, | 199 | int32_t x, int32_t y, int32_t width_mm, int32_t height_mm, |
200 | int32_t subpixel, const char *make, const char *model, | 200 | int32_t subpixel, const char *make, const char *model, |
201 | int32_t transform) { | 201 | int32_t transform) { |
202 | // Who cares | 202 | struct swaylock_surface *surface = data; |
203 | surface->subpixel = subpixel; | ||
204 | if (surface->state->run_display) { | ||
205 | damage_surface(surface); | ||
206 | } | ||
203 | } | 207 | } |
204 | 208 | ||
205 | static void handle_wl_output_mode(void *data, struct wl_output *output, | 209 | 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, | |||
841 | static struct swaylock_state state; | 845 | static struct swaylock_state state; |
842 | 846 | ||
843 | int main(int argc, char **argv) { | 847 | int main(int argc, char **argv) { |
848 | wlr_log_init(WLR_DEBUG, NULL); | ||
849 | initialize_pw_backend(); | ||
850 | |||
844 | enum line_mode line_mode = LM_LINE; | 851 | enum line_mode line_mode = LM_LINE; |
845 | state.args = (struct swaylock_args){ | 852 | state.args = (struct swaylock_args){ |
846 | .mode = BACKGROUND_MODE_SOLID_COLOR, | 853 | .mode = BACKGROUND_MODE_SOLID_COLOR, |
@@ -853,8 +860,6 @@ int main(int argc, char **argv) { | |||
853 | wl_list_init(&state.images); | 860 | wl_list_init(&state.images); |
854 | set_default_colors(&state.args.colors); | 861 | set_default_colors(&state.args.colors); |
855 | 862 | ||
856 | wlr_log_init(WLR_DEBUG, NULL); | ||
857 | |||
858 | char *config_path = NULL; | 863 | char *config_path = NULL; |
859 | int result = parse_options(argc, argv, NULL, NULL, &config_path); | 864 | int result = parse_options(argc, argv, NULL, NULL, &config_path); |
860 | if (result != 0) { | 865 | if (result != 0) { |