diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-08-23 11:50:25 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-08-23 11:50:25 +0000 |
commit | fd9dce6c66babe4f911efeedfd0ed496cea20e08 (patch) | |
tree | f275df9ada62bd37921df1787849de86170fe2fb /perl-install/Xconfig | |
parent | 8795d55cd84ac2b1d94af7d2cce1efc7ef339e25 (diff) | |
download | drakx-fd9dce6c66babe4f911efeedfd0ed496cea20e08.tar drakx-fd9dce6c66babe4f911efeedfd0ed496cea20e08.tar.gz drakx-fd9dce6c66babe4f911efeedfd0ed496cea20e08.tar.bz2 drakx-fd9dce6c66babe4f911efeedfd0ed496cea20e08.tar.xz drakx-fd9dce6c66babe4f911efeedfd0ed496cea20e08.zip |
(set_resolution): set the resolution on all Screen sections (otherwise Xinerama fails (?))
Diffstat (limited to 'perl-install/Xconfig')
-rw-r--r-- | perl-install/Xconfig/xfreeX.pm | 45 |
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 ]; + } } |