diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-05-07 10:15:17 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-05-07 10:15:17 +0000 |
commit | a72f7bb1d7790993ef294f770e80517a8761abfc (patch) | |
tree | dc38c66018ac81ad85bbf3c7e563889db45e66d7 /perl-install/Xconfig/xfree.pm | |
parent | 67fa57fea049bcb27429f921a84cbffdd83faee1 (diff) | |
download | drakx-a72f7bb1d7790993ef294f770e80517a8761abfc.tar drakx-a72f7bb1d7790993ef294f770e80517a8761abfc.tar.gz drakx-a72f7bb1d7790993ef294f770e80517a8761abfc.tar.bz2 drakx-a72f7bb1d7790993ef294f770e80517a8761abfc.tar.xz drakx-a72f7bb1d7790993ef294f770e80517a8761abfc.zip |
you can now configure monitors on heads > 1
Diffstat (limited to 'perl-install/Xconfig/xfree.pm')
-rw-r--r-- | perl-install/Xconfig/xfree.pm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/perl-install/Xconfig/xfree.pm b/perl-install/Xconfig/xfree.pm index c567192c9..33600f9c0 100644 --- a/perl-install/Xconfig/xfree.pm +++ b/perl-install/Xconfig/xfree.pm @@ -217,10 +217,16 @@ sub set_monitors { raw_import_section($raw_monitor, $monitor, \@monitor_fields); } \@raw_monitors, \@monitors; } -sub get_monitor { - my ($raw_X) = @_; - $raw_X->get_monitors or _new_monitor_sections($raw_X, 1); - first($raw_X->get_monitors); +sub get_or_new_monitors { + my ($raw_X, $nb_new) = @_; + my @monitors = $raw_X->get_monitors; + + #- ensure we have exactly $nb_new monitors; + if ($nb_new > @monitors) { + @monitors, ({}) x ($nb_new - @monitors); + } else { + splice(@monitors, 0, $nb_new); + } } sub _new_monitor_sections { my ($raw_X, $nb_new) = @_; |