| Summary: | Keyboard input "spills" out to the background console, even when grabbed | ||
|---|---|---|---|
| Product: | SDL | Reporter: | midwan |
| Component: | events | Assignee: | Manuel Alfayate Corchete <redwindwanderer> |
| Status: | ASSIGNED --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | cameron.gutman, ioq3 |
| Version: | 2.0.5 | Keywords: | target-2.0.16 |
| Hardware: | ARM | ||
| OS: | Linux | ||
|
Description
midwan
2017-03-20 13:01:37 UTC
Any progress with this? As a bug, it can manifest into a quite an ugly situation: Imagine someone typing something nasty withing the SDL2 application (like "sudo rm -F /boot"), it will get spilled to the console and executed if they hit Enter. Can you try the latest snapshot? http://www.libsdl.org/tmp/SDL-2.0.zip This should have been fixed in this commit: https://hg.libsdl.org/SDL/rev/fe9c7d01a093 Of course, I need a few days before I can run a test and I'll report back. Thanks! I'm having the same issue with keypresses leaking back to the x11 desktop when SDL2 is compiled with --disable-video-x11.
Tested on Raspberry Pi 3 with SDL2-2.0.8 and latest Raspbian Stretch. Thank you!
SDL2 Configure Options:
./configure --host=arm-raspberry-linux-gnueabihf \
--enable-alsa \
--disable-alsa-shared \
--disable-pulseaudio \
--disable-esd \
--disable-dummyaudio \
--disable-diskaudio \
--enable-video-kmsdrm \
--enable-video-rpi \
--disable-video-x11 \
--disable-video-dummy \
--disable-video-mir \
--disable-video-wayland \
--disable-video-vivante \
--disable-video-vulkan \
--disable-video-opengl
SDL2 Configure Summary:
Building Shared Libraries
Building Static Libraries
Enabled modules : atomic audio video render events joystick haptic power filesystem threads timers file loadso cpuinfo assembly
Assembly Math :
Audio drivers : oss alsa
Video drivers : rpi kmsdrm(dynamic) opengl_es1 opengl_es2
Input drivers : linuxev linuxkd
Using libsamplerate : YES
Using libudev : YES
Using dbus : YES
Using ime : YES
Using ibus : YES
Using fcitx : NO
It's been a while, but I'm afraid I need to come back to this one. When running an SDL2 app from the console, it seems to work normally now (using the latest SDL2 from Mercurial). However, if I run the same app as a service, then this bug manifests itself again - I get keyboard input "split" in the console behind. This still is an issue, at least for some users, even with the latest 2.0.12. We've had a related bug report about it today: https://github.com/midwan/amiberry/issues/748 It seems to be triggered only when running from the console (with no X11 loaded!), using KMSDRM for example. Do we have any progress update on it? I don't have a test setup for this. Manuel, can you look at this when you have time after 2.0.14 release? Thanks! This issue has no direct relationship with the KMSDRM backend, I believe, but affects the backend indirectly. I am not seeing it happen unless I launch an SDL2 program via SSH. Running the program on a local TTY, there is no key leakage to the console. The code that mutes the keyboard is exactly this one: https://hg.libsdl.org/SDL/file/c9d9e7ec5bf6/src/core/linux/SDL_evdev_kbd.c#l393 ...But that "trick" only works for local TTYs. I don't know much more about TTY keyboard, what's done there should be enough to prevent leakage. I don't know in what other situations this could be happening, other than trying to launch the program over SSH. What we probably want is EVIOCGRAB on the keyboard fd. We can make that the default behavior or plumb it through the new SetWindowKeyboardGrab() stuff I added recently. |