SDL_GRAB problem
Hi,
the usual grab agony: something goes wrong at the wrong time and X is completely unusable. No idea what exactly went wrong this time - luckilly ctrl-alt-f2 saved me.
Very unpleasant problem, should be fixed or avoided no matter how.
I have no idea about SDL, if I have to grab in X I do at least:
- handle Enter/Leave, Map/UnMap events
- add timer and enforce a maximum grab time, eg 45s
Also, if it is not absolutely necessary to grab the mouse it would be good to avoid this.
Richard
Quoted 2 lines · Richard Zidlicky
the usual grab agony: something goes wrong at the wrong time and X is completely unusable.
My X is currently stuck in this state.
Quoted 1 line
No idea what exactly went wrong this time - luckilly ctrl-alt-f2 saved me.
For me, qemu crashed while focus was grabbed. Also ctrl-alt-backspace is a handy command (use with caution, kills your X without asking twice)
Quoted 1 line
Very unpleasant problem, should be fixed or avoided no matter how.
I agree with you, it would ease the situation if there was a tool to ungrab X, but i don't know of any...
Regards, Sami
Quoted 8 lines · Sami Haahtinen
Quoted 2 lines · Richard Zidlicky
the usual grab agony: something goes wrong at the wrong time and X is completely unusable.
My X is currently stuck in this state.
Quoted 1 line
No idea what exactly went wrong this time - luckilly ctrl-alt-f2 saved me.
Quoted 7 lines
For me, qemu crashed while focus was grabbed. Also ctrl-alt-backspace is a handy command (use with caution, kills your X without asking twice)
Quoted 1 line
Very unpleasant problem, should be fixed or avoided no matter how.
I agree with you, it would ease the situation if there was a tool to ungrab X, but i don't know of any...
The solution I found is to relaunch qemu, grab then ungrab the focus and I get my X usable.
Qemu should do sthg to leave SDL in a proper way when it crashes...
Signature · 2 lines
J. Mayer <[email protected]> Never organized
Quoted 12 lines · J. Mayer
Quoted 11 lines · Sami Haahtinen
Quoted 2 lines · Richard Zidlicky
the usual grab agony: something goes wrong at the wrong time and X is completely unusable.
My X is currently stuck in this state.
Quoted 1 line
No idea what exactly went wrong this time - luckilly ctrl-alt-f2 saved me.
For me, qemu crashed while focus was grabbed. Also ctrl-alt-backspace is a handy command (use with caution, kills your X without asking twice)
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
Very unpleasant problem, should be fixed or avoided no matter how.
I agree with you, it would ease the situation if there was a tool to ungrab X, but i don't know of any...
From the XF86Config-4 manpage, about the ServerFlags section:
Option "AllowDeactivateGrabs" "boolean"
This option enables the use of the Ctrl+Alt+Keypad‐Divide key sequence to deactivate any active keyboard and mouse grabs.
Default: off.
[...]
Note that the options AllowDeactivateGrabs and AllowClosedown‐ Grabs will allow users to remove the grab used by screen saver/locker programs. An API was written to such cases. If you enable this option, make sure your screen saver/locker is updated.
Quoted 3 lines
The solution I found is to relaunch qemu, grab then ungrab the focus and I get my X usable.
Qemu should do sthg to leave SDL in a proper way when it crashes...
Strictly speaking, it may be an X server bug that the grab persists when the client goes away.
Signature · 2 lines
Earthling Michel Dänzer | Debian (powerpc), X and DRI developer Libre software enthusiast | http://svcs.affero.net/rm.php?r=daenzer
Quoted 11 lines · Michel Dänzer
Quoted 5 lines · J. Mayer
Quoted 1 line · Sami Haahtinen
I agree with you, it would ease the situation if there was a tool to ungrab X, but i don't know of any...
From the XF86Config-4 manpage, about the ServerFlags section:
Option "AllowDeactivateGrabs" "boolean"
This option enables the use of the Ctrl+Alt+Keypad‐Divide key sequence to deactivate any active keyboard and mouse grabs.
Default: off.
i must have missed that, that looks like a good solution. time to check whether my xscreensaver is new enough ;)
Quoted 6 lines
Quoted 3 lines
The solution I found is to relaunch qemu, grab then ungrab the focus and I get my X usable. Qemu should do sthg to leave SDL in a proper way when it crashes...
Strictly speaking, it may be an X server bug that the grab persists when the client goes away.
When you think it through, it does appear so. Why would an application that doesn't exist need grab. Although i don't know the full mechanism behind grab, so it might be that there is some reason why this hasn't been fixed.
Oh well, i'm looking forward to xouvert, somehow i have lost my faith in XFree86.
Regards, Sami
Quoted 7 lines · Sami Haahtinen
Quoted 2 lines · Michel Dänzer
Strictly speaking, it may be an X server bug that the grab persists when the client goes away.
When you think it through, it does appear so. Why would an application that doesn't exist need grab.
I can't think of a reason, but specs don't always follow reason. ;)
Quoted 2 lines
Although i don't know the full mechanism behind grab, so it might be that there is some reason why this hasn't been fixed.
IIRC the spec does define grabs to expire when the client goes away, but I don't know offhand where this is defined.
Quoted 2 lines
Oh well, i'm looking forward to xouvert, somehow i have lost my faith in XFree86.
You're not alone. Unfortunately, xouvert looked quite dead already last time I checked. Fortunately, there's a lot going on over at
http://freedesktop.org/Software/Home .
Quoted 4 lines · Richard Zidlicky
Now, excuse for the completely offtopic Q: Once every year or so my Xemacs looses sync with the Xserver.. usually there is some message suggesting xlib lost some reply or got an unexpected one. Is there any way to revive the app in such a case?
Not sure, but I'm afraid not - error recovery isn't exactly a strength of Xlib and most of its applications.
Signature · 2 lines
Earthling Michel Dänzer | Debian (powerpc), X and DRI developer Libre software enthusiast | http://svcs.affero.net/rm.php?r=daenzer
Quoted 4 lines · Michel Dänzer
Option "AllowDeactivateGrabs" "boolean"
This option enables the use of the Ctrl+Alt+Keypad???Divide key sequence to deactivate any active keyboard and mouse grabs.
Default: off.
that looks like an extremely usefull option for developpers, I don't even recall how often I needed a remote login to debug programs that use grabs :)
For the average user this is still a bit difficult I am afraid.
Quoted 2 lines
Strictly speaking, it may be an X server bug that the grab persists when the client goes away.
client didn't go away in my case so it is not an X bug. An strace displayed some SIGALRM in qemu and nothing else as far as I could see. After killing qemu the X server was fine again.
Now, excuse for the completely offtopic Q: Once every year or so my Xemacs looses sync with the Xserver.. usually there is some message suggesting xlib lost some reply or got an unexpected one. Is there any way to revive the app in such a case?
Richard