1
0
mirror of synced 2026-01-13 15:37:38 +00:00

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.
This commit is contained in:
Nick Briggs 2021-02-27 17:59:06 -08:00 committed by GitHub
parent a5356980f0
commit 14415e197f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")