diff options
-rw-r--r-- | sway/desktop/output.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 7b7fcbb9..a3d9efd8 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -46,18 +46,22 @@ 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 | double ox = lx, oy = ly; | 49 | int owidth, oheight; |
50 | wlr_output_layout_output_coords(layout, wlr_output, &ox, &oy); | 50 | wlr_output_effective_resolution(wlr_output, &owidth, &oheight); |
51 | ox *= wlr_output->scale; | ||
52 | oy *= wlr_output->scale; | ||
53 | 51 | ||
54 | struct wlr_box render_box = { | 52 | // FIXME: view coords are inconsistently assumed to be in output or layout coords |
55 | .x = lx, .y = ly, | 53 | struct wlr_box layout_box = { |
54 | .x = lx + owidth, .y = ly + oheight, | ||
56 | .width = render_width, .height = render_height, | 55 | .width = render_width, .height = render_height, |
57 | }; | 56 | }; |
58 | if (wlr_output_layout_intersects(layout, wlr_output, &render_box)) { | 57 | if (wlr_output_layout_intersects(layout, wlr_output, &layout_box)) { |
58 | struct wlr_box render_box = { | ||
59 | .x = lx, .y = ly, | ||
60 | .width = render_width, .height = render_height | ||
61 | }; | ||
59 | float matrix[16]; | 62 | float matrix[16]; |
60 | wlr_matrix_project_box(&matrix, &render_box, surface->current->transform, 0, &wlr_output->transform_matrix); | 63 | wlr_matrix_project_box(&matrix, &render_box, |
64 | surface->current->transform, 0, &wlr_output->transform_matrix); | ||
61 | wlr_render_with_matrix(server.renderer, surface->texture, | 65 | wlr_render_with_matrix(server.renderer, surface->texture, |
62 | &matrix); | 66 | &matrix); |
63 | 67 | ||