summaryrefslogtreecommitdiffstats
path: root/perl-install/Xconfig/resolution_and_depth.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-07-31 20:06:12 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-07-31 20:06:12 +0000
commit270d7af054112aeabcedde0474ab863843520268 (patch)
tree1c694918fbf0b55dc0cceb9dcdd347389050c70e /perl-install/Xconfig/resolution_and_depth.pm
parent5f03757d7b26bc05792239210c88d9b2e7ab2205 (diff)
downloaddrakx-270d7af054112aeabcedde0474ab863843520268.tar
drakx-270d7af054112aeabcedde0474ab863843520268.tar.gz
drakx-270d7af054112aeabcedde0474ab863843520268.tar.bz2
drakx-270d7af054112aeabcedde0474ab863843520268.tar.xz
drakx-270d7af054112aeabcedde0474ab863843520268.zip
(choose_gtk): ensure the response is one of @resolutions (so that Y and maybe bios is kept)
(to_string): created
Diffstat (limited to 'perl-install/Xconfig/resolution_and_depth.pm')
-rw-r--r--perl-install/Xconfig/resolution_and_depth.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/perl-install/Xconfig/resolution_and_depth.pm b/perl-install/Xconfig/resolution_and_depth.pm
index 75639d9d0..816af1916 100644
--- a/perl-install/Xconfig/resolution_and_depth.pm
+++ b/perl-install/Xconfig/resolution_and_depth.pm
@@ -66,6 +66,13 @@ sub size2default_resolution {
$monitorSize2resolution{round($size)} || ($size < 13 ? "640x480" : "1600x1200");
}
+sub to_string {
+ my ($resolution) = @_;
+ $resolution or return;
+
+ sprintf("%sx%s %dbpp", @$resolution{'X', 'Y', 'Depth'});
+}
+
sub allowed {
my ($card) = @_;
@@ -280,7 +287,7 @@ sub choose_gtk {
$x_res_combo->entry->set_text($chosen_x_res . "x" . $x_res2y_res{$chosen_x_res});
$W->main or return;
- { X => $chosen_x_res, Depth => $chosen_Depth };
+ first(grep { $_->{X} == $chosen_x_res && $_->{Depth} == $chosen_Depth } @resolutions);
}
1;