x11config.pl revision f902ede7eb073d09a81c1d470c089c7b14921714
#
# innotek VirtualBox
#
# Guest Additions X11 config update script
#
# Copyright (C) 2006-2008 innotek GmbH
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
my @cfg_files = ("/etc/X11/xorg.conf-4", "/etc/X11/xorg.conf", "/etc/X11/.xorg.conf", "/etc/xorg.conf",
"/usr/X11R6/lib/X11/XF86Config-4", "/usr/X11R6/lib/X11/XF86Config");
my $CFG;
my $TMP;
my $config_count = 0;
{
{
my $have_mouse = 0;
my $in_section = 0;
{
{
my $section = lc($1);
{
$in_section = 1;
}
if ($section eq "serverlayout")
{
$in_layout = 1;
}
} else {
if ($line =~ /^\s*EndSection/i)
{
$in_section = 0;
$in_layout = 0;
}
}
if ($in_section)
{
{
$line = " Driver \"vboxmouse\"\n Option \"CorePointer\"\n";
$have_mouse = 1
}
# Other drivers sending events interfere badly with pointer integration
{
$line = "";
}
if ($os_type =~ 'SunOS')
{
{
$line = " Option \"Device\" \"\/dev\/kdmouse\"\n"
}
}
{
$line = " Driver \"vboxvideo\"\n";
}
}
if ($in_layout)
{
# Other drivers sending events interfere badly with pointer integration
{
$line = "";
}
}
}
if (!$have_mouse) {
print TMP "\n";
print TMP "Section \"InputDevice\"\n";
print TMP " Identifier \"VBoxMouse\"\n";
print TMP " Driver \"vboxmouse\"\n";
if ($os_type eq 'SunOS')
{
print TMP " Option \"Device\" \"\/dev\/kdmouse\"\n";
}
print TMP " Option \"CorePointer\"\n";
print TMP "EndSection\n";
}
close(TMP);
system("cp $temp $cfg");
unlink $temp;
{
}
$config_count++;
}
}