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