summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeandro Ribeiro <leandrohr@riseup.net>2020-01-25 14:40:49 -0300
committerDaniel Stone <daniels@collabora.com>2020-08-26 14:10:50 +0000
commit55b4b47ec1824c7a4b51434e01c8a8bd5dbf8d4b (patch)
tree9fdf2f0430f04ee1a17966110ed6e1e20d227631
parent048c628139d3716aa7ace3cf2d65fd47d84682d7 (diff)
downloadweston-55b4b47ec1824c7a4b51434e01c8a8bd5dbf8d4b.tar.gz
weston-55b4b47ec1824c7a4b51434e01c8a8bd5dbf8d4b.tar.bz2
weston-55b4b47ec1824c7a4b51434e01c8a8bd5dbf8d4b.zip
exposay: centralize exposay's surfaces in their own square
Commit "exposay: add margins to centralize exposay" has centralized the whole exposay, but that's not enough. The internal surfaces of exposay are not centralized. Each internal surface of exposay is a square, but most of the windows are rectangular. Add margin to centralize exposay's surfaces in their own square. Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
-rw-r--r--desktop-shell/exposay.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/desktop-shell/exposay.c b/desktop-shell/exposay.c
index 7836dc03..09bc3f26 100644
--- a/desktop-shell/exposay.c
+++ b/desktop-shell/exposay.c
@@ -348,6 +348,13 @@ exposay_layout(struct desktop_shell *shell, struct shell_output *shell_output)
esurface->width = view->surface->width * esurface->scale;
esurface->height = view->surface->height * esurface->scale;
+ /* Surfaces are usually rectangular, but their exposay surfaces
+ * are square. centralize them in their own square */
+ if (esurface->width > esurface->height)
+ esurface->y += (esurface->width - esurface->height) / 2;
+ else
+ esurface->x += (esurface->height - esurface->width) / 2;
+
if (shell->exposay.focus_current == esurface->view)
highlight = esurface;