diff options
Diffstat (limited to 'sway/handlers.c')
-rw-r--r-- | sway/handlers.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sway/handlers.c b/sway/handlers.c index 3f3c1bdd..9e98cffe 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -3,6 +3,7 @@ | |||
3 | #include <stdbool.h> | 3 | #include <stdbool.h> |
4 | #include <math.h> | 4 | #include <math.h> |
5 | #include <wlc/wlc.h> | 5 | #include <wlc/wlc.h> |
6 | #include <wlc/wlc-wayland.h> | ||
6 | #include <ctype.h> | 7 | #include <ctype.h> |
7 | 8 | ||
8 | #include "handlers.h" | 9 | #include "handlers.h" |
@@ -17,6 +18,7 @@ | |||
17 | #include "focus.h" | 18 | #include "focus.h" |
18 | #include "input_state.h" | 19 | #include "input_state.h" |
19 | #include "resize.h" | 20 | #include "resize.h" |
21 | #include "extensions.h" | ||
20 | 22 | ||
21 | // Event should be sent to client | 23 | // Event should be sent to client |
22 | #define EVENT_PASSTHROUGH false | 24 | #define EVENT_PASSTHROUGH false |
@@ -63,6 +65,18 @@ static void handle_output_destroyed(wlc_handle output) { | |||
63 | } | 65 | } |
64 | } | 66 | } |
65 | 67 | ||
68 | static void handle_output_pre_render(wlc_handle output) { | ||
69 | int i; | ||
70 | for (i = 0; i < desktop_shell.backgrounds->length; ++i) { | ||
71 | struct background_config *config = desktop_shell.backgrounds->items[i]; | ||
72 | if (config->output == output) { | ||
73 | sway_log(L_DEBUG, "Rendering background surface %d", (int)config->surface); | ||
74 | wlc_surface_render(config->surface, &(struct wlc_geometry){ wlc_origin_zero, *wlc_output_get_resolution(output) }); | ||
75 | break; | ||
76 | } | ||
77 | } | ||
78 | } | ||
79 | |||
66 | static void handle_output_resolution_change(wlc_handle output, const struct wlc_size *from, const struct wlc_size *to) { | 80 | static void handle_output_resolution_change(wlc_handle output, const struct wlc_size *from, const struct wlc_size *to) { |
67 | sway_log(L_DEBUG, "Output %u resolution changed to %d x %d", (unsigned int)output, to->w, to->h); | 81 | sway_log(L_DEBUG, "Output %u resolution changed to %d x %d", (unsigned int)output, to->w, to->h); |
68 | swayc_t *c = swayc_by_handle(output); | 82 | swayc_t *c = swayc_by_handle(output); |
@@ -463,7 +477,10 @@ struct wlc_interface interface = { | |||
463 | .created = handle_output_created, | 477 | .created = handle_output_created, |
464 | .destroyed = handle_output_destroyed, | 478 | .destroyed = handle_output_destroyed, |
465 | .resolution = handle_output_resolution_change, | 479 | .resolution = handle_output_resolution_change, |
466 | .focus = handle_output_focused | 480 | .focus = handle_output_focused, |
481 | .render = { | ||
482 | .pre = handle_output_pre_render | ||
483 | } | ||
467 | }, | 484 | }, |
468 | .view = { | 485 | .view = { |
469 | .created = handle_view_created, | 486 | .created = handle_view_created, |