forked from len0rd/rockbox
X11 simulator: Always restore the x11 button autorepeat setting, regardless at which point exit() is called.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6216 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
74b731edc6
commit
3b8dcf5ebb
1 changed files with 8 additions and 3 deletions
|
|
@ -241,7 +241,7 @@ static Bool MapNotify_event_p (Display *dpy, XEvent *event, XPointer window)
|
|||
static Atom XA_WM_PROTOCOLS, XA_WM_DELETE_WINDOW;
|
||||
|
||||
|
||||
void kb_disable_auto_repeat(bool on)
|
||||
static void kb_disable_auto_repeat(bool on)
|
||||
{
|
||||
XKeyboardControl kb;
|
||||
|
||||
|
|
@ -249,6 +249,12 @@ void kb_disable_auto_repeat(bool on)
|
|||
XChangeKeyboardControl(dpy, KBAutoRepeatMode, &kb);
|
||||
}
|
||||
|
||||
static void kb_restore_auto_repeat(void) /* registered as an exit handler */
|
||||
{
|
||||
kb_disable_auto_repeat(false);
|
||||
XSync(dpy, false); /* force the X server to process that */
|
||||
}
|
||||
|
||||
/* Dead-trivial event handling.
|
||||
Exit if the WM_PROTOCOLS WM_DELETE_WINDOW ClientMessage is received.
|
||||
*/
|
||||
|
|
@ -312,8 +318,6 @@ int screenhack_handle_event(XEvent *event, bool *release)
|
|||
progname, s1, s2);
|
||||
}
|
||||
else {
|
||||
kb_disable_auto_repeat(false);
|
||||
XSync(dpy, false); /* force the X server to process that */
|
||||
exit (0);
|
||||
}
|
||||
break;
|
||||
|
|
@ -569,6 +573,7 @@ int main (int argc, char **argv)
|
|||
|
||||
XSync (dpy, False);
|
||||
|
||||
atexit(kb_restore_auto_repeat);
|
||||
kb_disable_auto_repeat(true);
|
||||
screenhack(); /* doesn't return */
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue