summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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};
}