aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-06-02 08:13:01 -0700
committerGitHub <noreply@github.com>2018-06-02 08:13:01 -0700
commitdf204b65d84ba0a1d005922f0a9a616e1757d3b1 (patch)
treef0dcbf9a703ff838c1500c743b9d19c6730be7d3 /sway
parentb0f2fd94791708a84aac2eccc57855a4ce8b6ec0 (diff)
parent65845be802673f50b3021999c4b59b1c7a7c8c39 (diff)
Merge pull request #2089 from emersion/send-frame-done-visible
Only send frame done to visible views
Diffstat (limited to 'sway')
-rw-r--r--sway/desktop/output.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 4047fa3f..763f053c 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -948,6 +948,11 @@ static void send_frame_done_container_iterator(struct sway_container *con,
if (!sway_assert(con->type == C_VIEW, "expected a view")) {
return;
}
+
+ if (!view_is_visible(con->sway_view)) {
+ return;
+ }
+
output_view_for_each_surface(con->sway_view, &data->root_geo,
send_frame_done_iterator, data);
}
@@ -1039,21 +1044,23 @@ static void damage_surface_iterator(struct wlr_surface *surface, int sx, int sy,
int center_x = box.x + box.width/2;
int center_y = box.y + box.height/2;
- pixman_region32_t damage;
- pixman_region32_init(&damage);
- pixman_region32_copy(&damage, &surface->current->surface_damage);
- wlr_region_scale(&damage, &damage, output->wlr_output->scale);
- if (ceil(output->wlr_output->scale) > surface->current->scale) {
- // When scaling up a surface, it'll become blurry so we need to
- // expand the damage region
- wlr_region_expand(&damage, &damage,
- ceil(output->wlr_output->scale) - surface->current->scale);
+ if (pixman_region32_not_empty(&surface->current->surface_damage)) {
+ pixman_region32_t damage;
+ pixman_region32_init(&damage);
+ pixman_region32_copy(&damage, &surface->current->surface_damage);
+ wlr_region_scale(&damage, &damage, output->wlr_output->scale);
+ if (ceil(output->wlr_output->scale) > surface->current->scale) {
+ // When scaling up a surface, it'll become blurry so we need to
+ // expand the damage region
+ wlr_region_expand(&damage, &damage,
+ ceil(output->wlr_output->scale) - surface->current->scale);
+ }
+ pixman_region32_translate(&damage, box.x, box.y);
+ wlr_region_rotated_bounds(&damage, &damage, rotation,
+ center_x, center_y);
+ wlr_output_damage_add(output->damage, &damage);
+ pixman_region32_fini(&damage);
}
- pixman_region32_translate(&damage, box.x, box.y);
- wlr_region_rotated_bounds(&damage, &damage, rotation,
- center_x, center_y);
- wlr_output_damage_add(output->damage, &damage);
- pixman_region32_fini(&damage);
if (whole) {
wlr_box_rotated_bounds(&box, rotation, &box);