AllowDeactivateGrabs is broken

Bug #338489 reported by Josh Lee
68
This bug affects 11 people
Affects Status Importance Assigned to Milestone
xorg-server (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I upgraded to Jaunty, and the AllowDeactivateGrabs option suddenly does not work. This option also seems to be missing from the xorg.conf (5) man page.

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
NonfreeKernelModules: nvidia
Package: xserver-xorg-core 2:1.5.99.902-0ubuntu7 [modified: usr/lib/xorg/modules/extensions/libglx.so]
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersion: Linux version 2.6.28-8-generic (buildd@rothera) (gcc version 4.3.3 (Ubuntu 4.3.3-3ubuntu5) ) #26-Ubuntu SMP Wed Feb 25 04:28:54 UTC 2009
SourcePackage: xorg-server
Uname: Linux 2.6.28-8-generic i686
Xrandr:

Revision history for this message
Josh Lee (jleedev) wrote :
Bryce Harrington (bryce)
Changed in xorg-server:
status: New → Confirmed
Revision history for this message
Tom Jaeger (thjaeger) wrote :
Revision history for this message
Justin Clift (justinclift) wrote :

Ouch. Just upgraded to Jaunty and went looking for how to deactivate screengrabs, hitting this exact problem.

Does anyone have or know a workaround?

This is critical core functionality for Salasaga, an eLearning creation package that's already available through Add/Remove.

Without the ability to trigger screenshots of applications with menu's open, which this bug is preventing, there's no way to create effective how-to style screenshots. :(

Revision history for this message
dcam (david-pastornet) wrote :

I see the same thing....

This is incredibly lousy... X grab hangs are a regular occurrence when debugging GUI applications.

If you don't have a network connection then as far as I know, there's no alternative but to power the machine down and suffer potential loss of data.

I don't understand why they'd remove it from the source.

Revision history for this message
Ville Leino (ville-leino) wrote :

Same issue here. This is a show stopper for GUI application development since you cannot switch back to the debugger when a breakpoint is hit.

Revision history for this message
dcam (david-pastornet) wrote :
Revision history for this message
dcam (david-pastornet) wrote :

I cannot work as a software developer without this functionality or some workable alternative. I'm now running Intrepid's X server in Jaunty.

This issue needs fixing as a matter of urgency.

Revision history for this message
dcam (david-pastornet) wrote :

See this thread I raised on the xorg mailing list
http://lists.freedesktop.org/archives/xorg/2009-May/thread.html#45750

Revision history for this message
dcam (david-pastornet) wrote :

If anyone can't wait (like me), I've built an Xorg binary for Ubuntu Jaunty that restores this AllowDeactivateGrabs functionality and also includes the patch provided in https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/334626 that stops regular server crashing, especially when running vmware player.
Binary is at http://www.aaa.net.au/campbell/Xorg.tar.bz2 and is a drop-in replacement for /usr/bin/Xorg but do back up your original. If installing you'll likely need to stop the gdm service, then restart it after you're done.

Revision history for this message
maq (testermanik) wrote :

I'm using this workaround on fedora9:
- the content of file /etc/acpi/actions/power.sh I modified to:

#!/bin/sh
/usr/bin/chvt 1

- so after X stops responding I just press POWER button on desktop machine and it will switch me to working terminal. Then I'm able to stop some process (e.g. when I'm using NetBeans, X will stop responding during debugging, I kill java process), then press alt+F7 and X will be responding again :)

Revision history for this message
dcam (david-pastornet) wrote :

That's certainly helpful, avoids a reboot, but if you're wanting to debug menu code that involves a grab, the above doesn't let you do it, rather you have to kill the process you were wanting to debug.

Revision history for this message
Chris Cowan (macil) wrote :

I've been trying to find a way to allow the mouse to be released from a program (UT2004) so that way I could do other things (answer IMs, browse internet) and switch back to the game later without exiting it. I heard this feature could let me do this easily, but then I find that the feature has been removed.

Bryce Harrington (bryce)
tags: added: jaunty
Revision history for this message
Bryce Harrington (bryce) wrote :

[This is an automatic notification.]

Hi Josh,

This bug was reported against an earlier version of Ubuntu, can you
test if it still occurs on Lucid?

Please note we also provide technical support for older versions of
Ubuntu, but not in the bug tracker. Instead, to raise the issue through
normal support channels, please see:

    http://www.ubuntu.com/support

If you are the original reporter and can still reproduce the issue on
Lucid, please run the following command to refresh the report:

  apport-collect 338489

If you are not the original reporter, please file a new bug report, so
we can work with you as the original reporter instead (you can reference
bug 338489 in your report if you think it may be related):

  ubuntu-bug xorg

If by chance you can no longer reproduce the issue on Lucid or if you
feel it is no longer relevant, please mark the bug report 'Fix Released'
or 'Invalid' as appropriate, at the following URL:

  https://bugs.launchpad.net/ubuntu/+bug/338489

Changed in xorg-server (Ubuntu):
status: Confirmed → Incomplete
tags: added: needs-retested-on-lucid-by-june
Revision history for this message
Josh Lee (jleedev) wrote :

apport-collect says "Package xorg-server not installed and no hook available, ignoring"

But the behavior hasn't magically reverted itself over the last year. This bug should either be reopened or marked as wontfix.

Josh Lee (jleedev)
Changed in xorg-server (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
dcam (david-pastornet) wrote :

This is a VERY SERIOUS problem for developers of GUI applications. Given this problem, the only realistic debugging approach for GUI apps is to run development environments in windows virtual machines.

Revision history for this message
dcam (david-pastornet) wrote :

This is going to be present in every modern Xorg distro including lucid, because AllowDeactivateGrabs has been INTENTIONALLY removed from X (http://cgit.freedesktop.org/xorg/xserver/commit/?id=5e43cd28692bc05cac80f38b47104a26c0524385) , even though it provides features that appear to have no workable alternatives.

Some of these X people look at everything from an entirely theoretical perspective, like AllowDeactivateGrabs shouldn't need to be there, and they're right because the grab-lockup problem shouldn't be there, but is. AllowDeactivateGrabs shouldn't have been removed until the grab-lockup problem is gone. By the grab lockup problem I mean there are some circumstances where an application does an X grab, and if you're then stopped at a debugger breakpoint, there's nothing that will release the grab, and then your entire desktop is locked up. You can't do a thing!!

Revision history for this message
lmartinking (lmartinking) wrote :

I have created a patch against the xorg-xserver-1.9.0 sources which re-enables grab deactivation and adds a little extra debug output (Should I be using ErrorF("...") is there something better to use?). See below:

http://www.lumaki.com/pub/patches/xorg-enable-grab-deactivation/README.txt
http://www.lumaki.com/pub/patches/xorg-enable-grab-deactivation/enable-grab-deactivation.patch

I also built some debs for Maverick AMD64 (but please be gentle it's my first time using debuild), available here:

http://www.lumaki.com/pub/patches/xorg-enable-grab-deactivation/ubuntu/

Revision history for this message
MMlosh (mmlosh) wrote :

There is another workaround mentioned in the X.org bug. (http://bugs.freedesktop.org/show_bug.cgi?id=21652)

compile a small library and LD_PRELOAD it. That seems to have fewer drawback than global anti-screenlocker feature.

Revision history for this message
dcam (david-pastornet) wrote :

But the workaround isn't effective because it breaks applications so you can't use them properly - menus don't work properly, so in the debugging scenario, you can't bring up the menu functionality you're wanting to test.

Revision history for this message
dcam (david-pastornet) wrote :

Debug key actions including one to deactivate grabs have very recently been added to the upstream X source

See recent comments by Daniel Stone at https://bugs.freedesktop.org/show_bug.cgi?id=21652

Revision history for this message
cfdman (plover5555) wrote :

here is a workaround that works with both KDE and GNOME 2.

to ungrab the keyboard in KDE. you should see the "show desktop" icon on your toolbar. right click it
then select the Show Desktop Settings click the field and type say Ctrl+Alt+d (or any sequence that you
would like but you may not want to overwrite any that KDE is currently using) and then that is your short cut.

when you run GDB and it locks up type Ctrl+Alt+d and it will minimize all the windows and then simply click on the Show Desktop Icon and you will find that the mouse is no longer grabbed and you can continue debugging.

for GNOME 2:

when you run GDB and it locks up type Ctrl+F12 to change desktops (should have at least 2 desktops for this to work) then Ctrl+F1 again to get back to the desktop where you are running gdb and you will find that the mouse is no longer grabbed and you can continue debugging.

kind of hokey but it works.

Saif Warsi

Revision history for this message
Alan Coopersmith (alan-coopersmith) wrote :

Xorg 1.11 and later restored the feature upstream, though it's not enabled by
default due to the security issues of being able to bypass screen locks with it.
http://who-t.blogspot.com/2012/01/xkb-breaking-grabs-cve-2012-0064.html has
more info, as do the more recent comments in the upstream bug report at
https://bugs.freedesktop.org/show_bug.cgi?id=21652 .

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

right, closing as fixed, it's not going to be enabled by default but it's there if you want to enable it.

Changed in xorg-server (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.