summaryrefslogtreecommitdiffstats
path: root/lib/Xconfig/resolution_and_depth.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-25 15:11:27 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-25 15:11:27 +0000
commitda0efd11f88ac0611644ede0120d2572f9040246 (patch)
tree7553ce59e604d792b7c477a774e69456e9a9d5d9 /lib/Xconfig/resolution_and_depth.pm
parent97ed258da08e51ab9d12f923952f875db5456680 (diff)
downloaddrakx-kbd-mouse-x11-da0efd11f88ac0611644ede0120d2572f9040246.tar
drakx-kbd-mouse-x11-da0efd11f88ac0611644ede0120d2572f9040246.tar.gz
drakx-kbd-mouse-x11-da0efd11f88ac0611644ede0120d2572f9040246.tar.bz2
drakx-kbd-mouse-x11-da0efd11f88ac0611644ede0120d2572f9040246.tar.xz
drakx-kbd-mouse-x11-da0efd11f88ac0611644ede0120d2572f9040246.zip
- XFdrake:
o set "PreferredMode" in Monitor section if the user changes the resolution (we still do not use PreferredMode for the default resolution)
Diffstat (limited to 'lib/Xconfig/resolution_and_depth.pm')
-rw-r--r--lib/Xconfig/resolution_and_depth.pm25
1 files changed, 22 insertions, 3 deletions
diff --git a/lib/Xconfig/resolution_and_depth.pm b/lib/Xconfig/resolution_and_depth.pm
index 479ceda..dc3f446 100644
--- a/lib/Xconfig/resolution_and_depth.pm
+++ b/lib/Xconfig/resolution_and_depth.pm
@@ -214,7 +214,7 @@ sub configure {
} else {
$resolution = choose($in, $default_resolution, @resolutions) or return;
}
- set_resolution($raw_X, $resolution, @resolutions);
+ set_resolution_($raw_X, $monitors, $default_resolution, $resolution, @resolutions);
}
sub configure_auto_install {
@@ -232,12 +232,17 @@ sub configure_auto_install {
($default_resolution, @resolutions) = choices($raw_X, $resolution_wanted, $card, $monitors);
$default_resolution or die "you selected an unusable depth";
}
- set_resolution($raw_X, $default_resolution, @resolutions);
+ set_resolution($raw_X, $monitors, $default_resolution, @resolutions);
}
sub set_resolution {
- my ($raw_X, $resolution, @other) = @_;
+ my ($raw_X, $monitors, $resolution, @other) = @_;
+ set_resolution_($raw_X, $monitors, $resolution, $resolution, @other);
+}
+sub set_resolution_ {
+ my ($raw_X, $monitors, $default_resolution, $resolution, @other) = @_;
+ my $PreferredMode;
if (!$resolution->{automatic}) {
my $ratio = Xconfig::xfree::resolution2ratio($resolution, 'non-strict');
@other = uniq_ { XxY($_) } @other;
@@ -245,7 +250,21 @@ sub set_resolution {
@other = filter_on_ratio($ratio, @other);
set_915resolution($resolution) if is_915resolution_configured();
+
+ if (XxY($default_resolution) ne XxY($resolution)) {
+ log::l("setting PreferredMode since wanted resolution (" . XxY($resolution) . ") differs from the default one (" . XxY($default_resolution) . ")");
+ $PreferredMode = XxY($resolution);
+ }
}
+ if ($monitors->[0]{PreferredMode} ne $PreferredMode) {
+ if ($PreferredMode) {
+ $monitors->[0]{PreferredMode} = $PreferredMode;
+ } else {
+ delete $monitors->[0]{PreferredMode};
+ }
+ $raw_X->set_monitors(@$monitors);
+ }
+
set_default_background($resolution);
my $resolutions = [ $resolution, @other ];
$raw_X->set_resolutions($resolutions);