summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/Xconfig/parse.pm2
-rw-r--r--perl-install/Xconfig/xfree3.pm24
-rw-r--r--perl-install/Xconfig/xfree4.pm15
-rw-r--r--perl-install/Xconfig/xfreeX.pm28
4 files changed, 36 insertions, 33 deletions
diff --git a/perl-install/Xconfig/parse.pm b/perl-install/Xconfig/parse.pm
index ea1054835..6de7d8959 100644
--- a/perl-install/Xconfig/parse.pm
+++ b/perl-install/Xconfig/parse.pm
@@ -133,7 +133,7 @@ my %kind_names = (
Keyboard => [ qw(Protocol Driver XkbModel XkbLayout XkbDisable) ],
Monitor => [ qw(Identifier VendorName ModelName HorizSync VertRefresh) ],
Device => [ qw(Identifier VendorName BoardName Chipset Driver VideoRam Screen BusID DPMS power_saver) ],
- Display => [ qw(Depth Modes) ], # Subsection in Device
+ Display => [ qw(Depth Modes Virtual) ], # Subsection in Device
Screen => [ qw(Identifier Driver Device Monitor DefaultColorDepth) ],
InputDevice => [ qw(Identifier Driver Protocol Device Type Mode XkbModel XkbLayout XkbDisable Emulate3Buttons Emulate3Timeout) ],
WacomCursor => [ qw(Port) ], #-\
diff --git a/perl-install/Xconfig/xfree3.pm b/perl-install/Xconfig/xfree3.pm
index 8f61fe55a..2c753f148 100644
--- a/perl-install/Xconfig/xfree3.pm
+++ b/perl-install/Xconfig/xfree3.pm
@@ -85,6 +85,30 @@ sub set_wacoms {
sub depths { 8, 15, 16, 24, 32 }
+sub set_resolution {
+ my ($raw_X, $resolution, $o_Screen_) = @_;
+
+ foreach my $Screen ($o_Screen_ ? $o_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 ($raw_X->is_fbdev($Screen)) {
+ '"default"';
+ } else {
+ my @Modes = grep {
+ if_(m/(\d+)x(\d+)/,
+ $1 <= $resolution->{X} && (!$resolution->{Y} || $2 <= $resolution->{Y}));
+ } reverse @Xconfig::xfreeX::resolutions;
+ join(" ", map { qq("$_") } @Modes);
+ }
+ };
+ { l => { Depth => { val => $_ }, Modes => { val => $modes } } };
+ } $raw_X->depths ];
+ }
+}
+
sub get_device_section_fields {
qw(VendorName BoardName Chipset VideoRam); #-);
}
diff --git a/perl-install/Xconfig/xfree4.pm b/perl-install/Xconfig/xfree4.pm
index a6b1e424d..5c2d23286 100644
--- a/perl-install/Xconfig/xfree4.pm
+++ b/perl-install/Xconfig/xfree4.pm
@@ -84,13 +84,16 @@ sub set_wacoms {
sub depths { 8, 15, 16, 24 }
sub set_resolution {
- my ($raw_X, $resolution, $Screen) = @_;
-
- $resolution = +{ %$resolution };
- #- XFree4 doesn't like depth 32, silently replacing it with 24
- $resolution->{Depth} = 24 if $resolution->{Depth} eq '32';
+ my ($raw_X, $resolution, $o_Screen_) = @_;
+
+ foreach my $Screen ($o_Screen_ ? $o_Screen_ : $raw_X->get_screens) {
+ $Screen ||= $raw_X->get_default_screen or internal_error('no screen');
- $raw_X->SUPER::set_resolution($resolution, $Screen);
+ $Screen->{DefaultColorDepth} = { val => $resolution->{Depth} eq '32' ? 24 : $resolution->{Depth} };
+ $Screen->{Display} = [ map {
+ { l => { Depth => { val => $_ }, Virtual => { val => join(' ', @$resolution{'X', 'Y'}) } } };
+ } $raw_X->depths ];
+ }
}
sub get_device_section_fields {
diff --git a/perl-install/Xconfig/xfreeX.pm b/perl-install/Xconfig/xfreeX.pm
index deb69823c..b6223a7fa 100644
--- a/perl-install/Xconfig/xfreeX.pm
+++ b/perl-install/Xconfig/xfreeX.pm
@@ -172,35 +172,11 @@ sub get_resolution {
my $depth = val($Screen->{DefaultColorDepth});
my $Display = find { !$depth || val($_->{l}{Depth}) eq $depth } @{$Screen->{Display} || []} or return {};
- val($Display->{l}{Modes}) =~ /(\d+)x(\d+)/ or return {};
+ $Display->{l}{Virtual} && val($Display->{l}{Virtual}) =~ /(\d+)\s+(\d+)/ or
+ val($Display->{l}{Modes}) =~ /(\d+)x(\d+)/ or return {};
{ X => $1, Y => $2, Depth => val($Display->{l}{Depth}) };
}
-sub set_resolution {
- my ($raw_X, $resolution, $o_Screen_) = @_;
-
- foreach my $Screen ($o_Screen_ ? $o_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 ($raw_X->is_fbdev($Screen)) {
- '"default"';
- } else {
- my @Modes = grep {
- if_(m/(\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 ];
- }
-}
-
-
#-##############################################################################
#- common to xfree3 and xfree4
#-##############################################################################