summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-25 14:48:25 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-25 14:48:25 +0000
commitade8f5686b4bab9830a0ec2524959598fa57b37c (patch)
treeba7af4d0127ab1425d020323ed87b5c80a97b656
parent433310a6c1caeffabf0f1ccf309abe4bdf70fb4f (diff)
downloaddrakx-kbd-mouse-x11-ade8f5686b4bab9830a0ec2524959598fa57b37c.tar
drakx-kbd-mouse-x11-ade8f5686b4bab9830a0ec2524959598fa57b37c.tar.gz
drakx-kbd-mouse-x11-ade8f5686b4bab9830a0ec2524959598fa57b37c.tar.bz2
drakx-kbd-mouse-x11-ade8f5686b4bab9830a0ec2524959598fa57b37c.tar.xz
drakx-kbd-mouse-x11-ade8f5686b4bab9830a0ec2524959598fa57b37c.zip
create XxY() and use it
-rw-r--r--lib/Xconfig/xfree.pm8
1 files changed, 7 insertions, 1 deletions
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};
}