summaryrefslogtreecommitdiffstats
path: root/perl-install/Xconfig/xfreeX.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-08-23 11:50:25 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-08-23 11:50:25 +0000
commitfd9dce6c66babe4f911efeedfd0ed496cea20e08 (patch)
treef275df9ada62bd37921df1787849de86170fe2fb /perl-install/Xconfig/xfreeX.pm
parent8795d55cd84ac2b1d94af7d2cce1efc7ef339e25 (diff)
downloaddrakx-backup-do-not-use-fd9dce6c66babe4f911efeedfd0ed496cea20e08.tar
drakx-backup-do-not-use-fd9dce6c66babe4f911efeedfd0ed496cea20e08.tar.gz
drakx-backup-do-not-use-fd9dce6c66babe4f911efeedfd0ed496cea20e08.tar.bz2
drakx-backup-do-not-use-fd9dce6c66babe4f911efeedfd0ed496cea20e08.tar.xz
drakx-backup-do-not-use-fd9dce6c66babe4f911efeedfd0ed496cea20e08.zip
(set_resolution): set the resolution on all Screen sections (otherwise Xinerama fails (?))
Diffstat (limited to 'perl-install/Xconfig/xfreeX.pm')
-rw-r--r--perl-install/Xconfig/xfreeX.pm45
1 files changed, 26 insertions, 19 deletions
diff --git a/perl-install/Xconfig/xfreeX.pm b/perl-install/Xconfig/xfreeX.pm
index 17c9c3264..9b8744a4c 100644
--- a/perl-install/Xconfig/xfreeX.pm
+++ b/perl-install/Xconfig/xfreeX.pm
@@ -111,9 +111,13 @@ sub get_device {
first(get_devices($raw_X));
}
+sub get_screens {
+ my ($raw_X) = @_;
+ $raw_X->get_Sections('Screen');
+}
sub get_default_screen {
my ($raw_X) = @_;
- my @l = $raw_X->get_Sections('Screen');
+ my @l = get_screens($raw_X);
my @m = grep { $_->{Identifier} && val($_->{Identifier}) eq 'screen1' ||
$_->{Driver} && val($_->{Driver}) =~ /svga|accel/ } @l;
first(@m ? @m : @l);
@@ -174,24 +178,27 @@ sub get_resolution {
}
sub set_resolution {
- my ($raw_X, $resolution, $Screen) = @_;
- $Screen ||= $raw_X->get_default_screen or internal_error('no screen');
-
- $Screen->{DefaultColorDepth} = { val => $resolution->{Depth} };
- $Screen->{Display} = [ map {
- my $modes = do {
- if ($resolution->{fbdev}) {
- '"default"';
- } else {
- my @Modes = grep {
- /(\d+)x(\d+)/;
- $1 <= $resolution->{X} && (!$resolution->{Y} || $2 <= $resolution->{Y});
- } reverse our @resolutions;
- join(" ", map { qq("$_") } @Modes);
- }
- };
- { l => { Depth => { val => $_ }, Modes => { val => $modes } } };
- } $raw_X->depths ];
+ my ($raw_X, $resolution, $Screen_) = @_;
+
+ foreach my $Screen ($Screen_ ? $Screen_ : $raw_X->get_screens) {
+ $Screen ||= $raw_X->get_default_screen or internal_error('no screen');
+
+ $Screen->{DefaultColorDepth} = { val => $resolution->{Depth} };
+ $Screen->{Display} = [ map {
+ my $modes = do {
+ if ($resolution->{fbdev}) {
+ '"default"';
+ } else {
+ my @Modes = grep {
+ /(\d+)x(\d+)/;
+ $1 <= $resolution->{X} && (!$resolution->{Y} || $2 <= $resolution->{Y});
+ } reverse our @resolutions;
+ join(" ", map { qq("$_") } @Modes);
+ }
+ };
+ { l => { Depth => { val => $_ }, Modes => { val => $modes } } };
+ } $raw_X->depths ];
+ }
}