From: Leandro Ribeiro Date: Sat, 25 Jan 2020 17:40:49 +0000 (-0300) Subject: exposay: centralize exposay's surfaces in their own square X-Git-Tag: upstream/9.0.0~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=55b4b47ec1824c7a4b51434e01c8a8bd5dbf8d4b;p=platform%2Fupstream%2Fweston.git 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 --- 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;