xorg-x11-server/N_zap_warning_xserver.diff
Stefan Dirsch 540300e204 - Update to version 21.1.0
* The meson support is now fully mature. While autotools support
    will still be kept for this release series, it will be dropped
    afterwards.
  * Glamor support for Xvfb.
  * Variable refresh rate support in the modesetting driver.
  * XInput 2.4 support which adds touchpad gestures.
  * DMX DDX has been removed.
  * X server now correctly reports display DPI in more cases. This
    may affect rendering of client applications that have their own
    workarounds for hi-DPI screens.
  * A large number of small features and various bug fixes.
- updated xorg-server-provides
- supersedes patches
  * U_Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch
  * U_dix-window-Use-ConfigureWindow-instead-of-MoveWindow.patch
  * U_glamor_egl-Reject-OpenGL-2.1-early-on.patch
  * u_render-Cast-color-masks-to-unsigned-long-before-shifting-them.patch
- refreshed patches
  * N_fix-dpi-values.diff
  * N_zap_warning_xserver.diff
  * u_modesetting-Fix-dirty-updates-for-sw-rotation.patch
  * u_randr-Do-not-crash-if-slave-screen-does-not-have-pro.patch
  * u_vesa-Add-VBEDPMSGetCapabilities-VBEDPMSGet.patch
- disabled n_xserver-optimus-autoconfig-hack.patch, which I believe is 
  superseded by:
  commit 078277e4d92f05a90c4715d61b89b9d9d38d68ea
  Author: Dave Airlie <airlied@redhat.com>
  Date:   Fri Aug 17 09:49:24 2012 +1000
    xf86: autobind GPUs to the screen
- added pkgconfig(libxcvt)
- cvt binary moved to libxcvt0 package

OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=804
2021-10-27 16:05:03 +00:00

94 lines
3.4 KiB
Diff

From: Luc Verhaegen <lverhaegen@suse.de>
Handle 'Zap' - Ctrl-Alt-Backspace more gracefully
To avoid accidental zapping of the Xserver warn after
the first ctrl-alt-backspace by emitting a beep. Only
Zap the server if a second ctrl-alt-backspace is sent
within 2 seconds.
This can be enabled with a new option flag "ZapWarning"
Index: xorg-server-21.1.0/hw/xfree86/common/xf86Config.c
===================================================================
--- xorg-server-21.1.0.orig/hw/xfree86/common/xf86Config.c
+++ xorg-server-21.1.0/hw/xfree86/common/xf86Config.c
@@ -621,6 +621,7 @@ configFiles(XF86ConfFilesPtr fileconf)
typedef enum {
FLAG_DONTVTSWITCH,
FLAG_DONTZAP,
+ FLAG_ZAPWARNING,
FLAG_DONTZOOM,
FLAG_DISABLEVIDMODE,
FLAG_ALLOWNONLOCAL,
@@ -657,6 +658,8 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE},
{FLAG_DONTZAP, "DontZap", OPTV_BOOLEAN,
{0}, FALSE},
+ { FLAG_ZAPWARNING, "ZapWarning", OPTV_BOOLEAN,
+ {0}, FALSE },
{FLAG_DONTZOOM, "DontZoom", OPTV_BOOLEAN,
{0}, FALSE},
{FLAG_DISABLEVIDMODE, "DisableVidModeExtension", OPTV_BOOLEAN,
@@ -739,6 +742,7 @@ configServerFlags(XF86ConfFlagsPtr flags
xf86GetOptValBool(FlagOptions, FLAG_DONTVTSWITCH, &xf86Info.dontVTSwitch);
xf86GetOptValBool(FlagOptions, FLAG_DONTZAP, &xf86Info.dontZap);
+ xf86GetOptValBool(FlagOptions, FLAG_ZAPWARNING, &xf86Info.ZapWarning);
xf86GetOptValBool(FlagOptions, FLAG_DONTZOOM, &xf86Info.dontZoom);
xf86GetOptValBool(FlagOptions, FLAG_IGNORE_ABI, &xf86Info.ignoreABI);
Index: xorg-server-21.1.0/hw/xfree86/common/xf86Events.c
===================================================================
--- xorg-server-21.1.0.orig/hw/xfree86/common/xf86Events.c
+++ xorg-server-21.1.0/hw/xfree86/common/xf86Events.c
@@ -158,10 +158,22 @@ xf86ProcessActionEvent(ActionEvent actio
DebugF("ProcessActionEvent(%d,%p)\n", (int) action, arg);
switch (action) {
case ACTION_TERMINATE:
- if (!xf86Info.dontZap) {
- xf86Msg(X_INFO, "Server zapped. Shutting down.\n");
- GiveUp(0);
+ 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(30, 1000, 50);
+ LastZap = NewZap;
+ break;
+ }
}
+ GiveUp(0);
break;
case ACTION_NEXT_MODE:
if (!xf86Info.dontZoom)
Index: xorg-server-21.1.0/hw/xfree86/common/xf86Globals.c
===================================================================
--- xorg-server-21.1.0.orig/hw/xfree86/common/xf86Globals.c
+++ xorg-server-21.1.0/hw/xfree86/common/xf86Globals.c
@@ -107,6 +107,7 @@ xf86InfoRec xf86Info = {
.autoVTSwitch = TRUE,
.ShareVTs = FALSE,
.dontZap = FALSE,
+ .ZapWarning = TRUE,
.dontZoom = FALSE,
.currentScreen = NULL,
#ifdef CSRG_BASED
Index: xorg-server-21.1.0/hw/xfree86/common/xf86Privstr.h
===================================================================
--- xorg-server-21.1.0.orig/hw/xfree86/common/xf86Privstr.h
+++ xorg-server-21.1.0/hw/xfree86/common/xf86Privstr.h
@@ -62,6 +62,7 @@ typedef struct {
Bool autoVTSwitch;
Bool ShareVTs;
Bool dontZap;
+ Bool ZapWarning;
Bool dontZoom;
/* graphics part */