diff options
Diffstat (limited to 'sway/desktop/desktop.c')
-rw-r--r-- | sway/desktop/desktop.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/sway/desktop/desktop.c b/sway/desktop/desktop.c index 72650397..771b58fe 100644 --- a/sway/desktop/desktop.c +++ b/sway/desktop/desktop.c | |||
@@ -4,37 +4,32 @@ | |||
4 | 4 | ||
5 | void desktop_damage_surface(struct wlr_surface *surface, double lx, double ly, | 5 | void desktop_damage_surface(struct wlr_surface *surface, double lx, double ly, |
6 | bool whole) { | 6 | bool whole) { |
7 | for (int i = 0; i < root_container.children->length; ++i) { | 7 | for (int i = 0; i < root->outputs->length; ++i) { |
8 | struct sway_container *cont = root_container.children->items[i]; | 8 | struct sway_output *output = root->outputs->items[i]; |
9 | if (cont->type == C_OUTPUT) { | 9 | output_damage_surface(output, lx - output->wlr_output->lx, |
10 | output_damage_surface(cont->sway_output, | 10 | ly - output->wlr_output->ly, surface, whole); |
11 | lx - cont->current.swayc_x, ly - cont->current.swayc_y, | ||
12 | surface, whole); | ||
13 | } | ||
14 | } | 11 | } |
15 | } | 12 | } |
16 | 13 | ||
17 | void desktop_damage_whole_container(struct sway_container *con) { | 14 | void desktop_damage_whole_container(struct sway_container *con) { |
18 | for (int i = 0; i < root_container.children->length; ++i) { | 15 | for (int i = 0; i < root->outputs->length; ++i) { |
19 | struct sway_container *cont = root_container.children->items[i]; | 16 | struct sway_output *output = root->outputs->items[i]; |
20 | if (cont->type == C_OUTPUT) { | 17 | output_damage_whole_container(output, con); |
21 | output_damage_whole_container(cont->sway_output, con); | ||
22 | } | ||
23 | } | 18 | } |
24 | } | 19 | } |
25 | 20 | ||
26 | void desktop_damage_box(struct wlr_box *box) { | 21 | void desktop_damage_box(struct wlr_box *box) { |
27 | for (int i = 0; i < root_container.children->length; ++i) { | 22 | for (int i = 0; i < root->outputs->length; ++i) { |
28 | struct sway_container *cont = root_container.children->items[i]; | 23 | struct sway_output *output = root->outputs->items[i]; |
29 | output_damage_box(cont->sway_output, box); | 24 | output_damage_box(output, box); |
30 | } | 25 | } |
31 | } | 26 | } |
32 | 27 | ||
33 | void desktop_damage_view(struct sway_view *view) { | 28 | void desktop_damage_view(struct sway_view *view) { |
34 | desktop_damage_whole_container(view->swayc); | 29 | desktop_damage_whole_container(view->container); |
35 | struct wlr_box box = { | 30 | struct wlr_box box = { |
36 | .x = view->swayc->current.view_x - view->geometry.x, | 31 | .x = view->container->current.view_x - view->geometry.x, |
37 | .y = view->swayc->current.view_y - view->geometry.y, | 32 | .y = view->container->current.view_y - view->geometry.y, |
38 | .width = view->surface->current.width, | 33 | .width = view->surface->current.width, |
39 | .height = view->surface->current.height, | 34 | .height = view->surface->current.height, |
40 | }; | 35 | }; |