From 14415e197fd85a5f762f877ec236261cc8241eb5 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Sat, 27 Feb 2021 17:59:06 -0800 Subject: [PATCH] Fix run-medley -dimensions processing to make sensible choices (#217) Given a "-dimension WxH" argument, round up the W to a multiple of 32 for the Lisp window width and use an X window geometry with an additional 22 pixels for both W and H to account for the current scrollbar size so that the resulting X window will not require scrolling. --- run-medley | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/run-medley b/run-medley index 41475634..75b061d3 100755 --- a/run-medley +++ b/run-medley @@ -59,8 +59,15 @@ while [ "$#" -ne 0 ]; do shift ;; "--dimensions" | "-dimensions") - geometry="-g $2" - screensize="-sc $2" + sw=`expr "$2" : "\([0-9]*\)x[0-9]*$"` + sh=`expr "$2" : "[0-9]*x\([0-9]*\)$"` + if [ -n "$sw" -a -n "$sh" ] ; then + sw=$(( (31+$sw)/32*32 )) + gw=$(( 22+$sw )) + gh=$(( 22+$sh )) + geometry="-g ${gw}x${gh}" + screensize="-sc ${sw}x${sh}" + fi shift ;; "--geometry" | "-geometry" | "-g")