No description
Find a file
Sam Lantinga 572de23fec Fixed bug 1990 - focus/keyboard events not generated correctly for multiple windows
Mai Lavelle

I've recently tried to create multiple windows and process key events for them, and found that key events weren't being generated for most of the windows. After some investigating I've observed the following effects. All but the most recently created window experience these effects...

- a focus lost event is generated immediately after the focus gained event, even tho window still has focus
- key events report window id 0 rather than the id of the window which has focus, SDL thinks no window has focus?
- giving focus to a non SDL window and then selecting an SDL window causes events to be generated as expected, but only until focus changes again

Focus change events are queued and delayed (200 ticks) before they are dispatched.  The problem occurs when a focus out and focus in event are received on the same tick.  When these delayed events are dispatched they will be sent in the order determined by the window list rather than the order in which they are received.

The focus out dispatch is implemented by calling SDL_SetKeyboardFocus(NULL).  This will remove focus from any window, regardless of whether it is the one originally targeted by the X11 event.

Since SDL_SetKeyboardFocus() will always dispatch a focus lost event as needed, the easiest solution is simply to only call SDL_SetKeyboardFocus(NULL) when SDL_GetKeyboardFocus() matches the target window.
2013-11-03 09:55:27 -08:00
acinclude We have to fix the DLL name convention on Windows every time... 2012-10-19 21:43:41 -07:00
android-project Fixed bug 2156 - Android: Accelerometer values fed to joystick driver are inverted for the X axis and wrong for Z 2013-10-20 23:52:02 -07:00
build-scripts Do a full sysroot for the Raspberry Pi buildbot. 2013-10-11 10:58:05 -04:00
cmake Fixed bug 2108 - CMake does not set X11 includes properly for sdl2-config and friends 2013-10-18 00:49:59 -07:00
debian Updated Debian package version to 2.0.1 2013-10-23 16:32:56 -07:00
include Clarified that SDL_memset4 is a 32-bit assignment and fixed a compiler warning 2013-11-03 09:42:23 -08:00
src Fixed bug 1990 - focus/keyboard events not generated correctly for multiple windows 2013-11-03 09:55:27 -08:00
test Changed parameter name for gesture template save functions from "src" to "dst". 2013-11-02 12:07:21 +01:00
VisualC Fixed project conflict during commit 2013-10-14 09:14:09 -07:00
Xcode Fixed bug 2168 - Mac: SDL_filesystem.h not exported to public header folder when building framework 2013-10-21 02:46:16 -07:00
Xcode-iOS Testing fullscreen window in the accelerometer test. 2013-10-22 21:53:42 -07:00
.hgignore Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module. 2013-08-20 19:57:11 -04:00
.hgtags Added tag release-2.0.1 for changeset b9663c77f5c9 2013-10-23 20:58:39 -07:00
Android.mk Fixed bug 2146 - Enable static linking of libSDL on Android 2013-10-10 21:51:39 -07:00
autogen.sh Need to generate aclocal.m4 when rebuilding configure, but we don't need to check it in. 2013-05-26 16:01:40 -07:00
BUGS.txt Credits were truncated in a previous commit. 2013-05-27 21:44:16 -07:00
CMakeLists.txt Fixed bug 2061 - SDL_filesystem API not built using cmake 2013-10-21 00:22:07 -07:00
configure Fixed bug 2149 - Don't search for libusbhid except on BSD 2013-10-13 19:49:45 -07:00
configure.in Fixed bug 2149 - Don't search for libusbhid except on BSD 2013-10-13 19:49:45 -07:00
COPYING.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
CREDITS.txt Added Julian Winter to the credits for the SDL 2.0 website. 2013-08-12 08:45:37 -07:00
INSTALL.txt Updated the installation instructions to cover all supported platforms 2013-05-26 12:42:46 -07:00
Makefile.in Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module. 2013-08-20 19:57:11 -04:00
Makefile.minimal Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module. 2013-08-20 19:57:11 -04:00
Makefile.pandora Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module. 2013-08-20 19:57:11 -04:00
Makefile.psp Added SDL_GetBasePath() and SDL_GetPrefPath() in new filesystem module. 2013-08-20 19:57:11 -04:00
Makefile.wiz
README-android.txt Fixed bug 2146 - Enable static linking of libSDL on Android 2013-10-10 21:51:39 -07:00
README-cmake.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-directfb.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
README-gesture.txt Changed parameter name for gesture template save functions from "src" to "dst". 2013-11-02 12:07:21 +01:00
README-hg.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
README-ios.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
README-macosx.txt Mac: Better handling when someone else is the app delegate. 2013-10-07 16:01:40 -07:00
README-pandora.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-platforms.txt Updated supported iOS version. 2013-07-12 23:16:11 -07:00
README-porting.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-psp.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-raspberrypi.txt Prevent keystrokes from leaking through to the console when using evdev. 2013-10-13 17:15:43 -03:00
README-SDL.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README-touch.txt Fixed recently deleted Ms in READMEs. 2013-05-30 12:15:00 +02:00
README-wince.txt Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
README.txt Better wording suggested by the community 2013-08-09 21:09:49 -07:00
sdl2-config.in Revert fix for bug 1392 because it breaks linking with mingw32 2013-10-21 10:28:57 -07:00
sdl2.m4 Fixed bug 1976 - SDL2.m4 shares same variables as SDL.m4 so they cache values 2013-07-21 11:52:16 -07:00
sdl2.pc.in Revert fix for bug 1392 because it breaks linking with mingw32 2013-10-21 10:28:57 -07:00
SDL2.spec.in Renamed documentation files to .txt and converted them to DOS line endings so they would open properly on all systems. 2013-05-26 11:06:17 -07:00
TODO.txt Added __WINDOWS__ to reflect both 32 and 64-bit windows platforms 2013-10-20 20:41:30 -07:00
VisualC.html Changed paths and name of header file in text of VisualC.html. 2013-06-29 22:08:38 +02:00
WhatsNew.txt Added patch notes for 2.0.1 2013-10-21 22:27:07 -07:00

                         Simple DirectMedia Layer

                                  (SDL)

                                Version 2.0

---
http://www.libsdl.org/

Simple DirectMedia Layer is a cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D. It is used by video playback software,
emulators, and popular games including Valve's award winning catalog
and many Humble Bundle games.

SDL officially supports Windows, Mac OS X, Linux, iOS, and Android.
Support for other platforms may be found in the source code.

SDL is written in C, works natively with C++, and there are bindings 
available for several other languages, including C# and Python.

This library is distributed under the zlib license, which can be found
in the file "COPYING.txt".

The best way to learn how to use SDL is to check out the header files in
the "include" subdirectory and the programs in the "test" subdirectory.
The header files and test programs are well commented and always up to date.
More documentation and FAQs are available online at:
	http://wiki.libsdl.org/

If you need help with the library, or just want to discuss SDL related
issues, you can join the developers mailing list:
	http://www.libsdl.org/mailing-list.php

Enjoy!
	Sam Lantinga				(slouken@libsdl.org)