diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-03 18:14:46 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-07 00:03:49 +1000 |
commit | f1fadef923ef8b1278bf2e380ab639f32c0cf79b (patch) | |
tree | 03da31379e31a213c06926caa046b88fb1bbf916 | |
parent | Use opaque region to determine if frame done should be sent (diff) | |
download | sway-f1fadef923ef8b1278bf2e380ab639f32c0cf79b.tar.gz sway-f1fadef923ef8b1278bf2e380ab639f32c0cf79b.tar.zst sway-f1fadef923ef8b1278bf2e380ab639f32c0cf79b.zip |
Use pixman_region32_contains_rectangle
-rw-r--r-- | sway/desktop/output.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index a6b2ebc2..fa85d260 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -930,16 +930,13 @@ bool output_has_opaque_lockscreen(struct sway_output *output, | |||
930 | if (wlr_surface->resource->client != seat->exclusive_client) { | 930 | if (wlr_surface->resource->client != seat->exclusive_client) { |
931 | continue; | 931 | continue; |
932 | } | 932 | } |
933 | int nrects; | 933 | pixman_box32_t output_box = { |
934 | pixman_box32_t *rects = | 934 | .x2 = output->swayc->current.swayc_width, |
935 | pixman_region32_rectangles(&wlr_surface->current->opaque, &nrects); | 935 | .y2 = output->swayc->current.swayc_height, |
936 | for (int i = 0; i < nrects; ++i) { | 936 | }; |
937 | pixman_box32_t *rect = &rects[i]; | 937 | if (pixman_region32_contains_rectangle(&wlr_surface->current->opaque, |
938 | if (rect->x1 <= 0 && rect->y1 <= 0 && | 938 | &output_box)) { |
939 | rect->x2 >= output->swayc->current.swayc_width && | 939 | return true; |
940 | rect->y2 >= output->swayc->current.swayc_height) { | ||
941 | return true; | ||
942 | } | ||
943 | } | 940 | } |
944 | } | 941 | } |
945 | return false; | 942 | return false; |