From 5bcc0d5952fabcaa52cee007099c62990e6f823a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Lefebvre?= Date: Wed, 9 Sep 2009 14:57:10 +0000 Subject: - XFdrake: o added "Disable Ctrl-Alt-Backspace" option --- lib/Xconfig/various.pm | 17 +++++++++++++++++ lib/Xconfig/xfree.pm | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/Xconfig/various.pm b/lib/Xconfig/various.pm index c5cae19..f1c3517 100644 --- a/lib/Xconfig/various.pm +++ b/lib/Xconfig/various.pm @@ -23,6 +23,7 @@ sub info { my $device = eval { $raw_X->get_device } || {}; my $mouse = eval { first($raw_X->get_mice) } || {}; + $info .= N("Disable Ctrl-Alt-Backspace: %s\n", configure_ServerFlag($raw_X, 'DontZap') eq 'True' ? N("yes") : N("no")); $info .= N("3D hardware acceleration: %s\n", translate(bool2yesno($card->{use_DRI_GLX} || $card->{DRI_GLX_SPECIAL}))); $info .= N("Keyboard layout: %s\n", $keyboard->{XkbLayout}); $info .= N("Mouse type: %s\n", $mouse->{Protocol}); @@ -49,6 +50,7 @@ sub default { add2hash_($various, { isLaptop => $isLaptop, xdm => 1, + DontZap => 1, Composite => !($card->{Driver} eq 'fglrx' || $card->{Driver} eq 'nvidia' && $card->{DriverVersion} eq '71xx'), if_($card->{Driver} eq 'nvidia', RenderAccel => !member($card->{DriverVersion}, qw(71xx 96xx)), Clone => 0, ForceModeDVI => 0), @@ -86,6 +88,7 @@ sub various { RenderAccel => !$card->{Options}{RenderAccel}, ), HWCursor => !$card->{Options}{SWCursor}, + DontZap => (configure_ServerFlag($raw_X, 'DontZap') eq 'True' ? 1 : 0), if_($card->{DRI_GLX} || $use_DRI_GLX, use_DRI_GLX => $use_DRI_GLX), ), }; @@ -110,6 +113,9 @@ sub various_auto_install { sub config { my ($raw_X, $card, $various) = @_; + if (exists $various->{DontZap}) { + configure_ServerFlag($raw_X, 'DontZap', $various->{DontZap} eq 1 ? 'True' : 'False'); + } if ($various->{Composite}) { $raw_X->remove_extension('Composite'); if ($card->{Driver} eq 'nvidia') { @@ -230,6 +236,9 @@ sub choose { my ($in, $various) = @_; $in->ask_from_({ title => N("Xorg configuration") }, [ + { label => N("Global options"), title => 1 }, + { text => N("Disable Ctrl-Alt-Backspace"), + type => 'bool', val => \$various->{DontZap} }, { label => N("Graphic card options"), title => 1 }, exists $various->{use_DRI_GLX} ? { text => N("3D hardware acceleration"), @@ -326,6 +335,14 @@ sub configure_FB_TVOUT { } } +sub configure_ServerFlag { + my ($raw_X, $option, $value) = @_; + my $ServerFlags = $raw_X->get_Section('ServerFlags'); + my $option_ref = $ServerFlags->{$option}->[0]; + $option_ref->{val} = $value if $value; + $option_ref->{val}; +} + sub check_xorg_conf_symlink() { my $f = "$::prefix/etc/X11/xorg.conf"; if (!-l $f && -e "$f.tvout") { diff --git a/lib/Xconfig/xfree.pm b/lib/Xconfig/xfree.pm index d962cfa..a98d8e6 100644 --- a/lib/Xconfig/xfree.pm +++ b/lib/Xconfig/xfree.pm @@ -875,7 +875,7 @@ our $default_header = <<'END'; # ********************************************************************** Section "ServerFlags" - #DontZap # disable (server abort) + Option "DontZap" "True" # disable (server abort) #DontZoom # disable / (resolution switching) AllowMouseOpenFail # allows the server to start up even if the mouse does not work END -- cgit v1.2.1