From 230f1fc68eb6b0104f70617e0d4c1c332d532f12 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 13 Sep 2005 14:16:55 +0000 Subject: handle DefaultDepth (which is the same as DefaultColorDepth) --- perl-install/Xconfig/parse.pm | 2 +- perl-install/Xconfig/xfree.pm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'perl-install/Xconfig') diff --git a/perl-install/Xconfig/parse.pm b/perl-install/Xconfig/parse.pm index 609534b54..71062a093 100644 --- a/perl-install/Xconfig/parse.pm +++ b/perl-install/Xconfig/parse.pm @@ -140,7 +140,7 @@ my %kind_names = ( Monitor => [ qw(Identifier VendorName ModelName HorizSync VertRefresh) ], Device => [ qw(Identifier VendorName BoardName Chipset Driver VideoRam Screen BusID DPMS power_saver) ], Display => [ qw(Depth Modes Virtual) ], # Subsection in Device - Screen => [ qw(Identifier Driver Device Monitor DefaultColorDepth) ], + Screen => [ qw(Identifier Driver Device Monitor DefaultDepth DefaultColorDepth) ], InputDevice => [ qw(Identifier Driver Protocol Device Type Mode XkbModel XkbLayout XkbDisable Emulate3Buttons Emulate3Timeout EmulateWheel EmulateWheelButton) ], WacomCursor => [ qw(Port) ], #-\ WacomStylus => [ qw(Port) ], #--> Port must be first diff --git a/perl-install/Xconfig/xfree.pm b/perl-install/Xconfig/xfree.pm index d783d4de3..8c3b7857c 100644 --- a/perl-install/Xconfig/xfree.pm +++ b/perl-install/Xconfig/xfree.pm @@ -141,7 +141,7 @@ sub get_resolution { my ($raw_X, $o_Screen) = @_; my $Screen = $o_Screen || $raw_X->get_default_screen or return {}; - my $depth = val($Screen->{DefaultColorDepth}); + my $depth = val($Screen->{DefaultColorDepth} || $Screen->{DefaultDepth}); my $Display = find { !$depth || val($_->{l}{Depth}) eq $depth } @{$Screen->{Display} || []} or return {}; $Display->{l}{Virtual} && val($Display->{l}{Virtual}) =~ /(\d+)\s+(\d+)/ or val($Display->{l}{Modes}) =~ /(\d+)x(\d+)/ or return {}; @@ -156,6 +156,7 @@ sub set_resolution { my $Mode_name = (any { $_->{l}{Modes} } @{$Screen->{Display} || []}) ? 'Modes' : 'Virtual'; my $Mode = sprintf($Mode_name eq 'Modes' ? '"%dx%d"' : '%d %d', @$resolution{'X', 'Y'}); + delete $Screen->{DefaultDepth}; $Screen->{DefaultColorDepth} = { val => $resolution->{Depth} eq '32' ? 24 : $resolution->{Depth} }; $Screen->{Display} = [ map { { l => { Depth => { val => $_ }, $Mode_name => { val => $Mode } } }; -- cgit v1.2.1