aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-07 01:18:54 +1000
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-07-07 01:18:54 +1000
commit464d4d58892597f31da3fcdbcfcd7928643a9ec3 (patch)
tree5543062b41b496e6caabf355c545eb3f7f5c044f /sway/desktop/output.c
parentDon't clear when using opaque lockscreen (diff)
downloadsway-464d4d58892597f31da3fcdbcfcd7928643a9ec3.tar.gz
sway-464d4d58892597f31da3fcdbcfcd7928643a9ec3.tar.zst
sway-464d4d58892597f31da3fcdbcfcd7928643a9ec3.zip
Translate surface by its geo when doing opaque box check
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 3c34040b..e5a42db0 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -930,12 +930,21 @@ 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 struct sway_layer_surface *sway_layer_surface =
934 layer_from_wlr_layer_surface(wlr_layer_surface);
933 pixman_box32_t output_box = { 935 pixman_box32_t output_box = {
934 .x2 = output->swayc->current.swayc_width, 936 .x2 = output->swayc->current.swayc_width,
935 .y2 = output->swayc->current.swayc_height, 937 .y2 = output->swayc->current.swayc_height,
936 }; 938 };
937 if (pixman_region32_contains_rectangle(&wlr_surface->current.opaque, 939 pixman_region32_t surface_opaque_box;
938 &output_box)) { 940 pixman_region32_init(&surface_opaque_box);
941 pixman_region32_copy(&surface_opaque_box, &wlr_surface->current.opaque);
942 pixman_region32_translate(&surface_opaque_box,
943 sway_layer_surface->geo.x, sway_layer_surface->geo.y);
944 bool contains = pixman_region32_contains_rectangle(
945 &wlr_surface->current.opaque, &output_box);
946 pixman_region32_fini(&surface_opaque_box);
947 if (contains) {
939 return true; 948 return true;
940 } 949 }
941 } 950 }