NetBSD Problem Report #8136
Received: (qmail 20988 invoked from network); 2 Aug 1999 19:49:18 -0000
Message-Id: <199908021948.PAA04132@bikini.ihack.net>
Date: Mon, 2 Aug 1999 15:48:20 -0400 (EDT)
From: "Charles M. Hannum" <root@ihack.net>
Reply-To: mycroft@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: recovering from grabby X applications
X-Send-Pr-Version: 3.95
>Number: 8136
>Category: xsrc
>Synopsis: recovering from grabby X applications
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: xsrc-manager
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Aug 02 12:50:01 +0000 1999
>Closed-Date: Tue Jul 06 21:20:51 +0000 2004
>Last-Modified: Tue Jul 06 21:20:51 +0000 2004
>Originator: Charles M. Hannum
>Release: 1.0
>Organization:
Internetwork Hacker
>Environment:
n/a
>Description:
One of the more common application failures these days is for
an application (e.g. Netscape Communicator) to wedge while it
has the keyboard and/or mouse grabbed (e.g. because a menu or
modal dialog box is being displayed). On major vendor systems
(i.e. without virtual terminals) it is sometimes impossible to
recover from this without rebooting the machine, or at least
killing the X server -- and it is always annoying.
I have decided to add another panic button (a la
Ctrl-Alt-BackSpace), which terminates connections to any
clients which currently have an active GrabServer,
GrabKeyboard, or GrabPointer. The choice of key sequence, and
the exact implementation are negotiable, but I think this is a
handy feature to have.
>How-To-Repeat:
Run Communicator for a while. You're bound to lose at some
point.
>Fix:
This patch has also been sent to xfree86@xfree86.org.
-----8<-----snip-----8<-----snip-----8<-----snip-----8<-----snip-----8<-----
Index: dix/dispatch.c
===================================================================
RCS file: /cvsroot/xsrc/xc/programs/Xserver/dix/dispatch.c,v
retrieving revision 1.1.1.2
diff -c -2 -r1.1.1.2 dispatch.c
*** dispatch.c 1997/06/30 12:53:53 1.1.1.2
--- dispatch.c 1999/08/02 19:32:58
***************
*** 66,69 ****
--- 66,70 ----
#include "swapreq.h"
#include "dixevents.h"
+ #include "inputstr.h"
#ifdef XCSECURITY
#define _SECURITY_SERVER
***************
*** 3953,3955 ****
--- 3954,3972 ----
{
client->noClientException = -1;
+ }
+
+ void
+ KillGrabbers()
+ {
+ extern InputInfo inputInfo;
+ ClientPtr client;
+
+ if (grabState != GrabNone)
+ CloseDownClient(grabClient);
+ if (inputInfo.pointer->grab &&
+ (client = LookupClient(inputInfo.pointer->grab->resource, NullClient)))
+ CloseDownClient(client);
+ if (inputInfo.keyboard->grab &&
+ (client = LookupClient(inputInfo.keyboard->grab->resource, NullClient)))
+ CloseDownClient(client);
}
Index: hw/xfree86/common/xf86Events.c
===================================================================
RCS file: /cvsroot/xsrc/xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v
retrieving revision 1.3
diff -c -2 -r1.3 xf86Events.c
*** xf86Events.c 1999/01/20 10:10:27 1.3
--- xf86Events.c 1999/08/02 19:32:59
***************
*** 694,697 ****
--- 694,701 ----
break;
+ case KEY_KP_Multiply:
+ KillGrabbers();
+ return;
+
/*
* The idea here is to pass the scancode down to a list of
-----8<-----snip-----8<-----snip-----8<-----snip-----8<-----snip-----8<-----
>Release-Note:
>Audit-Trail:
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
To: "Charles M. Hannum" <root@ihack.net>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: xsrc/8136: recovering from grabby X applications
Date: Tue, 3 Aug 1999 11:23:08 +0200
On Mon, Aug 02, 1999 at 03:48:20PM -0400, Charles M. Hannum wrote:
> >Description:
> One of the more common application failures these days is for
> an application (e.g. Netscape Communicator) to wedge while it
> has the keyboard and/or mouse grabbed (e.g. because a menu or
> modal dialog box is being displayed). On major vendor systems
> (i.e. without virtual terminals) it is sometimes impossible to
> recover from this without rebooting the machine, or at least
> killing the X server -- and it is always annoying.
>
> I have decided to add another panic button (a la
> Ctrl-Alt-BackSpace), which terminates connections to any
> clients which currently have an active GrabServer,
> GrabKeyboard, or GrabPointer. The choice of key sequence, and
> the exact implementation are negotiable, but I think this is a
> handy feature to have.
If I'm not mistacken this will also kill a running screensaver, isn't it ?
If so this feature (although nice, for sure) should be optional
(command line or XF86Config ?).
--
Manuel Bouyer, LIP6, Universite Paris VI. Manuel.Bouyer@lip6.fr
--
State-Changed-From-To: open->analyzed
State-Changed-By: tron
State-Changed-When: Wed Aug 4 13:32:39 PDT 1999
State-Changed-Why:
Because this feature could be used to kill a running screen locker it can
cause serious security problems. These problems have to be resolved before
the patch can be applied.
State-Changed-From-To: analyzed->closed
State-Changed-By: mycroft
State-Changed-When: Tue Jul 6 21:19:39 UTC 2004
State-Changed-Why:
The patch is considered a security hole as is. Also, desktop systems like KDE
include features to help with this now.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.