Ryujinx-SDL/src
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
..
atomic correct the comment correction.. 2018-06-30 20:10:40 +03:00
audio alsa: optionally run entire pipeline non-blocking. 2018-08-07 16:49:18 -04:00
core evdev: On sudden termination, make sure keyboard isn't lost (thanks, Tadek!) 2018-08-07 16:56:46 -04:00
cpuinfo cpuinfo: Added SDL_HasAVX512F(). 2018-05-21 11:35:42 -04:00
dynapi SDL_exp 2018-08-04 11:52:46 -04:00
events Some drag'and'drop improvements. 2018-08-02 16:03:47 -04:00
file Updated copyright for 2018 2018-01-03 10:03:25 -08:00
filesystem revert the recent typecast assignment changes (see bug #4079) 2018-02-12 17:00:00 +03:00
haptic haptic: Fix initial detection of haptic devices on Linux system 2018-08-07 12:06:31 -04:00
joystick Backed out changeset 794a209b2270 2018-08-06 13:00:11 -07:00
libm SDL_exp 2018-08-04 11:52:46 -04:00
loadso Updated copyright for 2018 2018-01-03 10:03:25 -08:00
main Fixed bug 4073 - Unquoted Unicode argument parsing broken on Windows due to incorrect usage of SDL_isspace() 2018-02-10 12:43:11 -08:00
power Handle NULL return from SDL_DBus_GetContext() 2018-04-23 20:24:12 -07:00
render gles2: Whoops, overzealous copy/paste on my part. :) 2018-06-25 01:57:28 -04:00
stdlib SDL_expf: return SDL_exp() instead of SDL_uclibc_exp() for consistency. 2018-08-05 10:01:01 +03:00
test Some drag'and'drop improvements. 2018-08-02 16:03:47 -04:00
thread thread: fixed compiler warnings on non-Linux systems that use pthread. 2018-05-21 12:00:21 -04:00
timer Updated copyright for 2018 2018-01-03 10:03:25 -08:00
video Some drag'and'drop improvements. 2018-08-02 16:03:47 -04:00
SDL_assert_c.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_assert.c use the 'aborts' pragma of Watcom for SDL_NORETURN functions 2018-06-13 14:45:02 +03:00
SDL_dataqueue.c Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_dataqueue.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_error_c.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_error.c Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_hints.c Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_internal.h Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL_log.c Updated copyright for 2018 2018-01-03 10:03:25 -08:00
SDL.c Fixed bug 4034 - Don't include _DllMainCRTStartup() if SDL_STATIC_LIB is defined. 2018-02-21 09:40:47 -08:00