From fd9dce6c66babe4f911efeedfd0ed496cea20e08 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 23 Aug 2002 11:50:25 +0000 Subject: (set_resolution): set the resolution on all Screen sections (otherwise Xinerama fails (?)) --- perl-install/Xconfig/xfreeX.pm | 45 ++++++++++++++++++++++++------------------ 1 file 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 ]; + } } -- cgit v1.2.1