scaling mode value is case sensitive, causing confusion
@kparal
Submitted by Kamil Páral Assigned to Keith Packard @keithp
Description
If I run xrandr --prop, I see this:
scaling mode: None
supported: None, Full, Center, Full aspect
Note that the value start with an upper-case letter. If I try to set the value with invalid casing, no error is printed out, but the scaling mode is not set accordingly. For example:
$ xrandr --output DisplayPort-0 --set "scaling mode" center $ xrandr --prop
scaling mode: center
supported: None, Full, Center, Full aspect
It seems like the new mode applied, but in fact, it is still "None". That is very confusing for people, as you can see for example in bug 80868 comment 17 to 19. It confused me as well in the beginning, because I also first tried to set the values all in lowercase, but fortunately I realized the modes could be case-sensitive and found out that it really makes a difference.
In order to make this functionality better usable and mistake-free, please consider one of this solutions:
a) make the values case-insensitive, so "center", "Center" and "CeNtEr" would all set Center mode correctly
- OR -
b) print out a warning/error about invalid mode name when a person tries to set a wrong-case mode name. Also, do not show this invalid mode name as the current mode. So:
$ xrandr --output DisplayPort-0 --set "scaling mode" center ERROR: Unknown "scaling mode" value "center". Supported modes are: <...>. Please note mode names are case sensitive.
$ xrandr --prop scaling mode: None <---- not replaced by invalid value "center" supported: None, Full, Center, Full aspect
Thank you.
xorg-x11-server-utils-7.7-17.fc23.x86_64
Version: 7.7 (2012.06)