From 2ac73a8b535f1a5d5c024935d37ad8eb06db6d2e Mon Sep 17 00:00:00 2001 From: Leandro Ribeiro Date: Sat, 25 Jan 2020 17:49:07 -0300 Subject: [PATCH] exposay: delete outer padding from struct exposay_output After some changes in the exposay layout, the outer padding makes no sense anymore. It was used to avoid the panel to get overlapped by the exposay surfaces and to keep distance from the borders of the window. Currently, the exposay is centralized and the panel cannot get overlapped. The outer padding just creates unnecessary unused space, what makes exposay's surfaces smaller. Delete outer padding from struct exposay_output. Signed-off-by: Leandro Ribeiro --- desktop-shell/exposay.c | 13 +++---------- desktop-shell/shell.h | 3 --- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/desktop-shell/exposay.c b/desktop-shell/exposay.c index 06b07ef1..7e9a324c 100644 --- a/desktop-shell/exposay.c +++ b/desktop-shell/exposay.c @@ -216,11 +216,10 @@ static void exposay_surface_and_inner_pad_size(pixman_rectangle32_t exposay_area, struct exposay_output *eoutput) { if (exposay_area.height < exposay_area.width) - eoutput->surface_size = - (exposay_area.height - (eoutput->vpadding_outer * 2)) / eoutput->grid_size; + eoutput->surface_size = exposay_area.height / eoutput->grid_size; else - eoutput->surface_size = - (exposay_area.width - (eoutput->hpadding_outer * 2)) / eoutput->grid_size; + eoutput->surface_size = exposay_area.width / eoutput->grid_size; + eoutput->padding_inner = eoutput->surface_size / 10; eoutput->surface_size -= eoutput->padding_inner; @@ -277,8 +276,6 @@ exposay_layout(struct desktop_shell *shell, struct shell_output *shell_output) if (eoutput->num_surfaces == 0) { eoutput->grid_size = 0; - eoutput->hpadding_outer = 0; - eoutput->vpadding_outer = 0; eoutput->padding_inner = 0; eoutput->surface_size = 0; return EXPOSAY_LAYOUT_OVERVIEW; @@ -293,10 +290,6 @@ exposay_layout(struct desktop_shell *shell, struct shell_output *shell_output) if (pow(eoutput->grid_size, 2) != eoutput->num_surfaces) eoutput->grid_size++; - /* Fixed outer padding of 10% the size of the screen */ - eoutput->hpadding_outer = (exposay_area.width / 10); - eoutput->vpadding_outer = (exposay_area.height / 10); - /* Compute each surface size and the inner padding between them */ exposay_surface_and_inner_pad_size(exposay_area, eoutput); diff --git a/desktop-shell/shell.h b/desktop-shell/shell.h index 6f72b357..9f0b6abe 100644 --- a/desktop-shell/shell.h +++ b/desktop-shell/shell.h @@ -62,9 +62,6 @@ struct exposay_output { int num_surfaces; int grid_size; int surface_size; - - int hpadding_outer; - int vpadding_outer; int padding_inner; };