From 50205ade9d7b3d4c014fce5364db329c29acfa86 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Mon, 8 Feb 2021 01:03:44 +0100 Subject: transaction: Move centering to view_center_surface This will allow us to reuse it for centering elsewhere. --- sway/desktop/transaction.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'sway/desktop/transaction.c') diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index 2d71ad2b..ead662f9 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c @@ -255,18 +255,7 @@ static void apply_container_state(struct sway_container *container, // the container. This is important for fullscreen views which // refuse to resize to the size of the output. if (view && view->surface) { - if (view->geometry.width < container->current.content_width) { - container->surface_x = container->current.content_x + - (container->current.content_width - view->geometry.width) / 2; - } else { - container->surface_x = container->current.content_x; - } - if (view->geometry.height < container->current.content_height) { - container->surface_y = container->current.content_y + - (container->current.content_height - view->geometry.height) / 2; - } else { - container->surface_y = container->current.content_y; - } + view_center_surface(view); } if (!container->node.destroying) { -- cgit v1.2.3-54-g00ecf