diff options
-rw-r--r-- | sway/desktop/output.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 63420d0c..2010e76e 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -37,7 +37,7 @@ static void rotate_child_position(double *sx, double *sy, double sw, double sh, | |||
37 | 37 | ||
38 | static void render_surface(struct wlr_surface *surface, | 38 | static void render_surface(struct wlr_surface *surface, |
39 | struct wlr_output *wlr_output, struct timespec *when, | 39 | struct wlr_output *wlr_output, struct timespec *when, |
40 | double lx, double ly, float rotation) { | 40 | double ox, double oy, float rotation) { |
41 | if (!wlr_surface_has_buffer(surface)) { | 41 | if (!wlr_surface_has_buffer(surface)) { |
42 | return; | 42 | return; |
43 | } | 43 | } |
@@ -46,17 +46,16 @@ static void render_surface(struct wlr_surface *surface, | |||
46 | int height = surface->current->height; | 46 | int height = surface->current->height; |
47 | int render_width = width * wlr_output->scale; | 47 | int render_width = width * wlr_output->scale; |
48 | int render_height = height * wlr_output->scale; | 48 | int render_height = height * wlr_output->scale; |
49 | int owidth, oheight; | 49 | ox *= wlr_output->scale; |
50 | wlr_output_effective_resolution(wlr_output, &owidth, &oheight); | 50 | oy *= wlr_output->scale; |
51 | 51 | ||
52 | // FIXME: view coords are inconsistently assumed to be in output or layout coords | ||
53 | struct wlr_box layout_box = { | 52 | struct wlr_box layout_box = { |
54 | .x = lx + wlr_output->lx, .y = ly + wlr_output->ly, | 53 | .x = ox + wlr_output->lx, .y = oy + wlr_output->ly, |
55 | .width = render_width, .height = render_height, | 54 | .width = render_width, .height = render_height, |
56 | }; | 55 | }; |
57 | if (wlr_output_layout_intersects(layout, wlr_output, &layout_box)) { | 56 | if (wlr_output_layout_intersects(layout, wlr_output, &layout_box)) { |
58 | struct wlr_box render_box = { | 57 | struct wlr_box render_box = { |
59 | .x = lx, .y = ly, | 58 | .x = ox, .y = oy, |
60 | .width = render_width, .height = render_height | 59 | .width = render_width, .height = render_height |
61 | }; | 60 | }; |
62 | float matrix[16]; | 61 | float matrix[16]; |
@@ -78,8 +77,8 @@ static void render_surface(struct wlr_surface *surface, | |||
78 | rotate_child_position(&sx, &sy, sw, sh, width, height, rotation); | 77 | rotate_child_position(&sx, &sy, sw, sh, width, height, rotation); |
79 | 78 | ||
80 | render_surface(subsurface->surface, wlr_output, when, | 79 | render_surface(subsurface->surface, wlr_output, when, |
81 | lx + sx, | 80 | ox + sx, |
82 | ly + sy, | 81 | oy + sy, |
83 | rotation); | 82 | rotation); |
84 | } | 83 | } |
85 | } | 84 | } |