Blog
Debugging Linux GUI apps.
23/6/2008
When you are running X windows apps in gdb and they grab the mouse and then crash or hit a breakpoint your console is locked out, you can't do anything except quit the app from a text terminal (i.e. Ctrl+Alt+F1).

However there is a better way. Add these lines to your X11 config:
Section "ServerFlags"
    Option "AllowDeactivateGrabs" "true"
EndSection


And restart X, now you should be able to use Ctrl+Alt+NumPad / to "ungrab" the mouse at any point and debug the issue in gdb.

Nice.

But it begs the question, why is it not on by default?


Comments:

lsoltero
24/06/2008 7:11am

Thank you! how did you discover this? this has been driving me nuts for years... Adding the text to my config file now as I type this...

--luis
fret
24/06/2008 7:14am
I got lucky with Google I guess, took me 10 minutes to find... :D

But yeah, I've been annoyed by it for years too. Maybe it's a recent feature added in the x.org version of the server.


From:
Email (optional): (Will be HTML encoded to evade harvesting)
Message:
 
Remember username and/or email in a cookie.
Notify me of new posts in this thread via email.
BBcode:
[q]text[/q]
[url=link]description[/url]
[img]url_to_image[/img]
[pre]some_code[/pre]
[b]bold_text[/b]
Post