summaryrefslogtreecommitdiffstats
path: root/lib/Xconfig
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Xconfig')
-rw-r--r--lib/Xconfig/various.pm8
-rw-r--r--lib/Xconfig/xfree.pm5
2 files changed, 9 insertions, 4 deletions
diff --git a/lib/Xconfig/various.pm b/lib/Xconfig/various.pm
index 5379d21..a762f0c 100644
--- a/lib/Xconfig/various.pm
+++ b/lib/Xconfig/various.pm
@@ -70,7 +70,7 @@ sub various {
my $various = {
if_($::isStandalone, xdm => runlevel() == 5),
if_($b_read_existing,
- Composite => ($raw_X->get_Section('Extensions') || {})->{Composite},
+ Composite => $raw_X->get_extension('Composite') ne 'Disable',
if_($card->{Options}{MonitorLayout} eq 'NONE,CRT+LFP' ||
$card->{Options}{TwinViewOrientation} eq 'Clone',
Clone => 1),
@@ -111,13 +111,13 @@ sub config {
my ($raw_X, $card, $various) = @_;
if ($various->{Composite}) {
- my $raw = $raw_X->get_Section('Extensions') || $raw_X->add_Section('Extensions', {});
- $raw->{Composite} = { 'Option' => 1 };
+ $raw_X->remove_extension('Composite');
if ($card->{Driver} eq 'nvidia') {
$card->{Options}{AddARGBGLXVisuals} = undef;
}
} else {
- $raw_X->remove_extension('Composite');
+ my $raw = $raw_X->get_Section('Extensions') || $raw_X->add_Section('Extensions', {});
+ $raw->{Composite} = { 'Option' => 1, val => 'Disable' };
if ($card->{Driver} eq 'nvidia') {
delete $card->{Options}{AddARGBGLXVisuals};
diff --git a/lib/Xconfig/xfree.pm b/lib/Xconfig/xfree.pm
index 23c0910..edb1541 100644
--- a/lib/Xconfig/xfree.pm
+++ b/lib/Xconfig/xfree.pm
@@ -535,6 +535,11 @@ sub remove_extension {
delete $raw->{$extension};
%$raw or $raw_X->remove_Section('Extensions');
}
+sub get_extension {
+ my ($raw_X, $extension) = @_;
+ my $raw = $raw_X->get_Section('Extensions');
+ $raw && $raw->{Composite} && $raw->{Composite}[0]{val};
+}
################################################################################
# ModulePath ###################################################################