summaryrefslogtreecommitdiffstats
path: root/lib/Xconfig/screen.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-04-25 10:04:32 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-04-25 10:04:32 +0000
commit48524e2dc24bae1e80dc7a39e490fe37c089adf3 (patch)
tree65b80153beda525c57dfeafb6134ce56385cc8ab /lib/Xconfig/screen.pm
parent0f62ff37f66fe87ebdf474831e8bf38c61c44f43 (diff)
downloaddrakx-kbd-mouse-x11-48524e2dc24bae1e80dc7a39e490fe37c089adf3.tar
drakx-kbd-mouse-x11-48524e2dc24bae1e80dc7a39e490fe37c089adf3.tar.gz
drakx-kbd-mouse-x11-48524e2dc24bae1e80dc7a39e490fe37c089adf3.tar.bz2
drakx-kbd-mouse-x11-48524e2dc24bae1e80dc7a39e490fe37c089adf3.tar.xz
drakx-kbd-mouse-x11-48524e2dc24bae1e80dc7a39e490fe37c089adf3.zip
re-sync after the big svn loss
Diffstat (limited to 'lib/Xconfig/screen.pm')
-rw-r--r--lib/Xconfig/screen.pm29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/Xconfig/screen.pm b/lib/Xconfig/screen.pm
new file mode 100644
index 0000000..e0a3ebd
--- /dev/null
+++ b/lib/Xconfig/screen.pm
@@ -0,0 +1,29 @@
+package Xconfig::screen; # $Id$
+
+use diagnostics;
+use strict;
+
+use common;
+
+
+sub configure {
+ my ($raw_X) = @_;
+
+ my @devices = $raw_X->get_devices;
+ my @monitors = $raw_X->get_monitors;
+
+ if (@monitors < @devices) {
+ $raw_X->set_monitors(@monitors, ({}) x (@devices - @monitors));
+ @monitors = $raw_X->get_monitors;
+ }
+
+ my @sections = mapn {
+ my ($device, $monitor) = @_;
+ { Device => $device->{Identifier}, Monitor => $monitor->{Identifier} };
+ } \@devices, \@monitors;
+
+ $raw_X->set_screens(@sections);
+ 1;
+}
+
+1;