summaryrefslogtreecommitdiffstats
path: root/lib/Xconfig/screen.pm
blob: 96fe9cefbed08acab96387c760de1cc2fd9705c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package Xconfig::screen; # $Id: screen.pm 210131 2004-11-18 13:25:45Z prigaux $

use diagnostics;
use strict;

use common;
# perl_checker: require Xconfig::xfree
# perl_checker: require MDK::Common

sub configure {
    my ($raw_X) = @_; # perl_checker: $raw_X = Xconfig::xfree->new

    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;