commit acf773022535b271d7e0060f513658e7b69afbfe
parent 4caf5cc2a3a3dbd872a0a88afc65d738ec5905c9
Author: Michael Forney <mforney@mforney.org>
Date: Thu, 30 Jan 2014 02:21:21 -0800
example/wm: Use ceil instead of round to calculate number of columns
Most monitors are wider than they are tall, so it makes sense to round
up.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/example/wm.c b/example/wm.c
@@ -65,7 +65,7 @@ static void arrange(struct screen * screen)
if (screen->num_windows == 0) return;
- num_columns = round(sqrt(screen->num_windows));
+ num_columns = ceil(sqrt(screen->num_windows));
num_rows = screen->num_windows / num_columns + 1;
window = wl_container_of(screen->windows.next, window, link);