From ade8f5686b4bab9830a0ec2524959598fa57b37c Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 25 Sep 2008 14:48:25 +0000 Subject: create XxY() and use it --- lib/Xconfig/xfree.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/Xconfig/xfree.pm') diff --git a/lib/Xconfig/xfree.pm b/lib/Xconfig/xfree.pm index 46c7ac0..f1f52c9 100644 --- a/lib/Xconfig/xfree.pm +++ b/lib/Xconfig/xfree.pm @@ -384,6 +384,12 @@ sub default_ModeLine() { ModeLine_from_string(qq(Section "Monitor"\n) . (our $default_ModeLine) . qq(EndSection\n)); } +sub XxY { + my ($resolution) = @_; + $resolution && $resolution->{X} && $resolution->{Y} && + $resolution->{X} . 'x' . $resolution->{Y}; +} + sub xorg_builtin_resolution { my ($X, $Y) = @_; my $res = $X . 'x' . $Y; @@ -394,7 +400,7 @@ sub xorg_builtin_resolution { sub resolution2ratio { my ($resolution, $b_non_strict) = @_; - my $res = $resolution->{X} . 'x' . $resolution->{Y}; + my $res = XxY($resolution); $res eq '1280x1024' && $b_non_strict ? '4/3' : $Xconfig::xfree::resolution2ratio{$res}; } -- cgit v1.2.1