diff options
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r-- | sway/desktop/output.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index d1c6dbf9..c150270e 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -191,17 +191,14 @@ static void scissor_output(struct wlr_output *wlr_output, | |||
191 | 191 | ||
192 | static void render_texture(struct wlr_output *wlr_output, | 192 | static void render_texture(struct wlr_output *wlr_output, |
193 | pixman_region32_t *output_damage, struct wlr_texture *texture, | 193 | pixman_region32_t *output_damage, struct wlr_texture *texture, |
194 | const struct wlr_box *_box, const float matrix[static 9], float alpha) { | 194 | const struct wlr_box *box, const float matrix[static 9], float alpha) { |
195 | struct wlr_renderer *renderer = | 195 | struct wlr_renderer *renderer = |
196 | wlr_backend_get_renderer(wlr_output->backend); | 196 | wlr_backend_get_renderer(wlr_output->backend); |
197 | 197 | ||
198 | struct wlr_box box = *_box; | ||
199 | scale_box(&box, wlr_output->scale); | ||
200 | |||
201 | pixman_region32_t damage; | 198 | pixman_region32_t damage; |
202 | pixman_region32_init(&damage); | 199 | pixman_region32_init(&damage); |
203 | pixman_region32_union_rect(&damage, &damage, box.x, box.y, | 200 | pixman_region32_union_rect(&damage, &damage, box->x, box->y, |
204 | box.width, box.height); | 201 | box->width, box->height); |
205 | pixman_region32_intersect(&damage, &damage, output_damage); | 202 | pixman_region32_intersect(&damage, &damage, output_damage); |
206 | bool damaged = pixman_region32_not_empty(&damage); | 203 | bool damaged = pixman_region32_not_empty(&damage); |
207 | if (!damaged) { | 204 | if (!damaged) { |
@@ -238,6 +235,8 @@ static void render_surface_iterator(struct wlr_surface *surface, int sx, int sy, | |||
238 | return; | 235 | return; |
239 | } | 236 | } |
240 | 237 | ||
238 | scale_box(&box, wlr_output->scale); | ||
239 | |||
241 | float matrix[9]; | 240 | float matrix[9]; |
242 | enum wl_output_transform transform = | 241 | enum wl_output_transform transform = |
243 | wlr_output_transform_invert(surface->current->transform); | 242 | wlr_output_transform_invert(surface->current->transform); |
@@ -384,7 +383,11 @@ static void render_container_simple_border_normal(struct sway_output *output, | |||
384 | 383 | ||
385 | // Title text | 384 | // Title text |
386 | if (title_texture) { | 385 | if (title_texture) { |
387 | struct wlr_box texture_box = { .x = box.x, .y = box.y }; | 386 | float output_scale = output->wlr_output->scale; |
387 | struct wlr_box texture_box = { | ||
388 | .x = box.x * output_scale, | ||
389 | .y = box.y * output_scale, | ||
390 | }; | ||
388 | wlr_texture_get_size(title_texture, | 391 | wlr_texture_get_size(title_texture, |
389 | &texture_box.width, &texture_box.height); | 392 | &texture_box.width, &texture_box.height); |
390 | 393 | ||
@@ -392,8 +395,8 @@ static void render_container_simple_border_normal(struct sway_output *output, | |||
392 | wlr_matrix_project_box(matrix, &texture_box, WL_OUTPUT_TRANSFORM_NORMAL, | 395 | wlr_matrix_project_box(matrix, &texture_box, WL_OUTPUT_TRANSFORM_NORMAL, |
393 | 0.0, output->wlr_output->transform_matrix); | 396 | 0.0, output->wlr_output->transform_matrix); |
394 | 397 | ||
395 | render_texture(output->wlr_output, output_damage, title_texture, &box, | 398 | render_texture(output->wlr_output, output_damage, title_texture, |
396 | matrix, 1.0); | 399 | &texture_box, matrix, 1.0); |
397 | } | 400 | } |
398 | } | 401 | } |
399 | 402 | ||
@@ -566,7 +569,7 @@ static void render_output(struct sway_output *output, struct timespec *when, | |||
566 | goto renderer_end; | 569 | goto renderer_end; |
567 | } | 570 | } |
568 | 571 | ||
569 | //wlr_renderer_clear(renderer, (float[]){1, 1, 0, 0}); | 572 | //wlr_renderer_clear(renderer, (float[]){1, 1, 0, 1}); |
570 | 573 | ||
571 | struct sway_container *workspace = output_get_active_workspace(output); | 574 | struct sway_container *workspace = output_get_active_workspace(output); |
572 | 575 | ||