SDL/src/core/linux
Ryan C. Gordon f59b0056d3 evdev: On sudden termination, make sure keyboard isn't lost (thanks, Tadek!)
"In release 2.0.6, when Linux evdev keyboard support has been moved to a
separate source file, a feature was added to disable normal keyboard event
processing to prevent "spilling" keystrokes to background virtual console.

This feature has one unpleasant side effect: if application fails to call
`SDL_Exit` before termination or crashes with fatal signal, console is left
in unusable state with keyboard not working and no possibility to switch
virtual console. If user has a chance, he can login remotely and restore
keyboard with `kbd_mode`, otherwise the only option is to reboot the machine.

This patch fixes that problem by intercepting fatal signals (with `sigaction`)
and process termination (with `atexit`), to restore keyboard state, if it
wasn't properly restored with `SDL_Exit`.

The function registered with `atexit` also restores original signal handlers,
to prevent leaving invalid handlers after SDL library is unloaded, if it was
loaded dynamically with `dlopen`.

No signal handlers or `atexit` function are installed if SDL boolean hint
`SDL_HINT_NO_SIGNAL_HANDLERS` is `SDL_TRUE`.

Additionally, if environment variable `SDL_INPUT_LINUX_KEEP_KBD` exists,
keyboard initialization function completely skips disabling keyboard. This
can be useful for debugging."

Fixes Bugzilla #4193.
2018-08-07 16:56:46 -04:00
..
SDL_dbus.c dbus: Deal with undefined behavior with va_args. 2018-07-13 17:53:24 -04:00
SDL_dbus.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_evdev.c Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_evdev.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_evdev_kbd.c evdev: On sudden termination, make sure keyboard isn't lost (thanks, Tadek!) 2018-08-07 16:56:46 -04:00
SDL_evdev_kbd.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_evdev_kbd_default_accents.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_evdev_kbd_default_keymap.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_fcitx.c Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_fcitx.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_ibus.c Fixed bug 3920 - IBus not work with SDL 2.0.7 2018-02-13 08:15:39 -08:00
SDL_ibus.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_ime.c Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_ime.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_udev.c Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_udev.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00