1
0
xorg-x11-server/zap_warning_xserver.diff

136 lines
5.8 KiB
Diff
Raw Normal View History

diff -ur xorg-server-1.4.0.90-orig//hw/xfree86/common/xf86Config.c xorg-server-1.4.0.90/hw/xfree86/common/xf86Config.c
diff -ur xorg-server-1.4.0.90-orig//hw/xfree86/common/xf86Events.c xorg-server-1.4.0.90/hw/xfree86/common/xf86Events.c
--- xorg-server-1.4.0.90-orig//hw/xfree86/common/xf86Events.c 2008-03-09 13:27:24.000000000 +0100
+++ xorg-server-1.4.0.90/hw/xfree86/common/xf86Events.c 2008-03-09 13:30:18.000000000 +0100
@@ -267,12 +267,26 @@
#endif
switch (action) {
case ACTION_TERMINATE:
- if (!xf86Info.dontZap) {
+ if (xf86Info.dontZap)
+ break;
+
+ if (xf86Info.ZapWarning) {
+ static struct timeval LastZap = { 0, 0};
+ struct timeval NewZap;
+
+ gettimeofday(&NewZap, NULL);
+
+ if ((NewZap.tv_sec - LastZap.tv_sec) >= 2) {
+ xf86OSRingBell(100, 1000, 500);
+ LastZap = NewZap;
+ break;
+ }
+ }
+
#ifdef XFreeXDGA
- DGAShutdown();
+ DGAShutdown();
#endif
- GiveUp(0);
- }
+ GiveUp(0);
break;
case ACTION_NEXT_MODE:
if (!xf86Info.dontZoom)
diff -ur xorg-server-1.4.0.90-orig//hw/xfree86/common/xf86Globals.c xorg-server-1.4.0.90/hw/xfree86/common/xf86Globals.c
diff -ur xorg-server-1.4.0.90-orig//hw/xfree86/common/xf86Privstr.h xorg-server-1.4.0.90/hw/xfree86/common/xf86Privstr.h
--- xorg-server-1.4.0.90-orig//hw/xfree86/common/xf86Privstr.h 2007-12-07 03:38:42.000000000 +0100
+++ xorg-server-1.4.0.90/hw/xfree86/common/xf86Privstr.h 2008-03-09 13:29:43.000000000 +0100
@@ -85,6 +85,7 @@
Bool inputPending;
Bool dontVTSwitch;
Bool dontZap;
+ Bool ZapWarning;
Bool dontZoom;
Bool notrapSignals; /* don't exit cleanly - die at fault */
Bool caughtSignal;
diff -ur xorg-server-1.4.0.90-orig//hw/xfree86/doc/man/xorg.conf.man.pre xorg-server-1.4.0.90/hw/xfree86/doc/man/xorg.conf.man.pre
--- xorg-server-1.4.0.90-orig//hw/xfree86/doc/man/xorg.conf.man.pre 2008-03-09 12:36:39.000000000 +0100
+++ xorg-server-1.4.0.90/hw/xfree86/doc/man/xorg.conf.man.pre 2008-03-09 13:42:36.000000000 +0100
@@ -446,6 +446,13 @@
is passed to clients.
Default: off.
.TP 7
+.BI "Option \*qZapWarning\*q \*q" boolean \*q
+This warns the user loudly when the
+.B Ctrl+Alt+Backspace
+sequence is pressed for the first time but still terminates the __xservername__
+server when this key-sequence is pressed again shortly after.
+Default: off.
+.TP 7
.BI "Option \*qDontZoom\*q \*q" boolean \*q
This disallows the use of the
.B Ctrl+Alt+Keypad\-Plus
--- xorg-server-1.6.0/hw/xfree86/common/xf86Config.c.orig 2009-02-25 20:12:11.000000000 +0100
+++ xorg-server-1.6.0/hw/xfree86/common/xf86Config.c 2009-02-27 16:28:19.000000000 +0100
@@ -697,6 +697,7 @@ typedef enum {
FLAG_NOTRAPSIGNALS,
FLAG_DONTVTSWITCH,
FLAG_DONTZAP,
+ FLAG_ZAPWARNING,
FLAG_DONTZOOM,
FLAG_DISABLEVIDMODE,
FLAG_ALLOWNONLOCAL,
@@ -734,6 +735,8 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE },
{ FLAG_DONTZAP, "DontZap", OPTV_BOOLEAN,
{0}, TRUE },
+ { FLAG_ZAPWARNING, "ZapWarning", OPTV_BOOLEAN,
+ {0}, FALSE },
{ FLAG_DONTZOOM, "DontZoom", OPTV_BOOLEAN,
{0}, FALSE },
{ FLAG_DISABLEVIDMODE, "DisableVidModeExtension", OPTV_BOOLEAN,
@@ -847,6 +850,7 @@ configServerFlags(XF86ConfFlagsPtr flags
xf86GetOptValBool(FlagOptions, FLAG_DONTVTSWITCH, &xf86Info.dontVTSwitch);
if (!xf86GetOptValBool(FlagOptions, FLAG_DONTZAP, &xf86Info.dontZap))
xf86Info.dontZap = !party_like_its_1989;
+ xf86GetOptValBool(FlagOptions, FLAG_ZAPWARNING, &xf86Info.ZapWarning);
xf86GetOptValBool(FlagOptions, FLAG_DONTZOOM, &xf86Info.dontZoom);
xf86GetOptValBool(FlagOptions, FLAG_IGNORE_ABI, &xf86Info.ignoreABI);
--- xorg-server-1.6.0/hw/xfree86/common/xf86Globals.c.orig 2009-02-27 16:23:51.000000000 +0100
+++ xorg-server-1.6.0/hw/xfree86/common/xf86Globals.c 2009-02-27 16:30:19.000000000 +0100
@@ -106,6 +106,7 @@ xf86InfoRec xf86Info = {
.vtRequestsPending = FALSE,
.dontVTSwitch = FALSE,
.dontZap = FALSE,
+ .ZapWarning = FALSE,
.dontZoom = FALSE,
.notrapSignals = FALSE,
.caughtSignal = FALSE,
--- xorg-server-1.6.0/hw/xfree86/doc/man/Xorg.man.pre.orig 2009-02-25 20:12:11.000000000 +0100
+++ xorg-server-1.6.0/hw/xfree86/doc/man/Xorg.man.pre 2009-02-27 16:32:45.000000000 +0100
@@ -452,8 +452,8 @@ are:
Immediately kills the server -- no questions asked. This is disabled by
default. It can be enabled with the -retro command line flag or by setting
the
-.B DontZap
-__xconfigfile__(__filemansuffix__) file option to a FALSE value.
+.B DontZap/ZapWarning
+__xconfigfile__(__filemansuffix__) file options to a FALSE value.
.TP 8
.B Ctrl+Alt+Keypad-Plus
Change video mode to next one specified in the configuration file.
--- xorg-server-1.6.0/hw/xfree86/common/xf86Config.c.orig 2009-02-28 20:29:42.000000000 +0100
+++ xorg-server-1.6.0/hw/xfree86/common/xf86Config.c 2009-02-28 20:30:44.000000000 +0100
@@ -734,7 +734,7 @@ static OptionInfoRec FlagOptions[] = {
{ FLAG_DONTVTSWITCH, "DontVTSwitch", OPTV_BOOLEAN,
{0}, FALSE },
{ FLAG_DONTZAP, "DontZap", OPTV_BOOLEAN,
- {0}, TRUE },
+ {0}, FALSE },
{ FLAG_ZAPWARNING, "ZapWarning", OPTV_BOOLEAN,
{0}, FALSE },
{ FLAG_DONTZOOM, "DontZoom", OPTV_BOOLEAN,
@@ -848,8 +848,7 @@ configServerFlags(XF86ConfFlagsPtr flags
xf86GetOptValBool(FlagOptions, FLAG_NOTRAPSIGNALS, &xf86Info.notrapSignals);
xf86GetOptValBool(FlagOptions, FLAG_DONTVTSWITCH, &xf86Info.dontVTSwitch);
- if (!xf86GetOptValBool(FlagOptions, FLAG_DONTZAP, &xf86Info.dontZap))
- xf86Info.dontZap = !party_like_its_1989;
+ xf86GetOptValBool(FlagOptions, FLAG_DONTZAP, &xf86Info.dontZap);
xf86GetOptValBool(FlagOptions, FLAG_ZAPWARNING, &xf86Info.ZapWarning);
xf86GetOptValBool(FlagOptions, FLAG_DONTZOOM, &xf86Info.dontZoom);