src/events/SDL_events.c


Log

Author Commit Date CI Message
Ryan C. Gordon fa23e3d0 2020-05-04T02:27:29 locale: Implemented SDL_GetPreferredLocales(). This was something I proposed a long time ago, Sylvain Becker did additional work on it, then back to me. Fixes Bugzilla #2131.
Sam Lantinga d4f1b520 2020-04-08T19:16:31 Added support for press/release hardware keyboard events in iOS 13.4
Sam Lantinga 1f4965c8 2020-03-08T21:24:06 Fixed warnings building with mingw64
Sam Lantinga 997f3e9e 2020-03-02T09:03:55 Fixed build warnings
Sam Lantinga b5849daf 2020-02-01T09:23:04 Fixed build warnings on Android
Sam Lantinga a8780c6a 2020-01-16T20:49:25 Updated copyright date for 2020
Sam Lantinga 526b9bdf 2019-10-14T22:41:27 Backed out changeset b0241180cdc5 Better commit incoming!
Ryan C. Gordon cd8652d8 2019-10-15T01:13:44 events: SDL_WaitEvent()'s polling loop now sleeps 1ms instead of 10ms. Fixes Bugzilla #4356.
Sam Lantinga f3226457 2019-06-19T17:11:20 Fixed bug 4672 - Warnings in SDL_LogEvent()
Ryan C. Gordon 12c5cda6 2019-03-16T00:08:19 Fix compiler warnings.
Ryan C. Gordon 8a5a05c1 2019-03-15T15:51:05 events: Let arbitrary signals to simulate iOS/Android backgrounding events. This lets you build a custom embedded device that roughly offers the "this process is going to the background NOW" semantics of SDL on a mobile device.
Ryan C. Gordon 911bf624 2019-03-15T14:08:30 events: Make debug logging of the event queue a hint instead of an #ifdef. This makes it easy to toggle it on when debugging a new platform (or just getting more visibility into an app) without having to rebuild SDL.
Sam Lantinga 5e13087b 2019-01-04T22:01:14 Updated copyright for 2019
Cameron Gutman 31ee4d3d 2018-11-03T15:46:42 Reduce delay to 1 ms in SDL_WaitEventTimeout() and SDL_WaitEvent() The 10 ms delay effectively caps input polling at 100 Hz and rendering at 100 FPS if applications use these functions in their event loop. The delay may also lead to dropped frames even at 60 FPS due if they are unlucky enough to hit the delay and rendering takes longer than 6 ms.
Sam Lantinga f8b4cd41 2018-09-30T19:53:26 Re-enable drag-and-drop events by default
Sam Lantinga 7c3040e0 2018-08-21T12:11:34 First pass on the new SDL sensor API
Ryan C. Gordon e061a92d 2018-08-02T16:03:47 Some drag'and'drop improvements. First: disable d'n'd events by default; most apps don't need these at all, and if an app doesn't explicitly handle these, each drop on the window will cause a memory leak if the events are enabled. This follows the guidelines we have for SDL_TEXTINPUT events already. Second: when events are enabled or disabled, signal the video layer, as it might be able to inform the OS, causing UI changes or optimizations (for example, dropping a file icon on a Cocoa app that isn't accepting drops will cause macOS to show a rejection animation instead of the drop operation just vanishing into the ether, X11 might show a different cursor when dragging onto an accepting window, etc). Third: fill in the drop event details in the test library and enable the events in testwm.c for making sure this all works as expected.
Sam Lantinga e3cc5b2c 2018-01-03T10:03:25 Updated copyright for 2018
Sam Lantinga ca729766 2017-12-12T16:10:20 Fixed bug 3996 - Corrupted or over-released critical section on SDL_Quit (SDL_event_watchers_lock) Andrew This likely comes down to an additional 'unlock' being called before destroying it, without a matching 'lock'.
Sam Lantinga b53c35df 2017-10-11T13:26:58 Fixed size in realloc
Sam Lantinga 8446d4a0 2017-10-10T20:11:05 Changed overlapping memcpy to memmove
Sam Lantinga eb9e6938 2017-10-10T19:44:33 Fixed potentially calling a callback after it has been removed (and userdata possibly deleted)
Sam Lantinga b647bd06 2017-10-10T17:41:41 The event filter and event watch functions are now thread-safe
Sam Lantinga 50efbda7 2017-08-28T00:43:14 Fixed mingw Windows build, since SDL_vulkan_internal.h includes windows.h
Sam Lantinga 45b774e3 2017-01-01T18:33:28 Updated copyright for 2017
Philipp Wiesemann 062ca2b2 2016-11-05T21:22:39 Removed empty statement.
Ryan C. Gordon 0f83ae0f 2016-11-03T01:29:56 Added some debug logging to print out every event added to the SDL queue.
Sam Lantinga 5c2320f1 2016-10-07T17:58:02 Fixed bug 3022 - SDL_UnlockMutex(SDL_EventQ.lock) in SDL_PeepEvents can cause error when lock is null
Sam Lantinga 6303941a 2016-03-08T13:55:50 Fixed infinite timeout in SDL_WaitEventTimeout() - thanks ?????????? ????????
Sam Lantinga 1fb30db0 2016-01-31T11:29:11 Return the full number of events from SDL_PeepEvents() if NULL is passed in with SDL_PEEKEVENT
Ryan C. Gordon fa8c83c1 2016-01-03T06:50:50 Remove almost all instances of "volatile" keyword. As Tiffany pointed out in Bugzilla, volatile is not useful for thread safety: https://software.intel.com/en-us/blogs/2007/11/30/volatile-almost-useless-for-multi-threaded-programming/ Some of these volatiles didn't need to be, some were otherwise protected by spinlocks or mutexes, and some got moved over to SDL_atomic_t data, etc. Fixes Bugzilla #3220.
Sam Lantinga 42065e78 2016-01-02T10:10:34 Updated copyright to 2016
Sam Lantinga 2b0140a9 2015-10-27T11:17:32 Add a new SDL_KEYMAPCHANGED SDL event to abstract notification of keyboard layout or input language changes.
Philipp Wiesemann 0e45984f 2015-06-21T17:33:46 Fixed crash if initialization of EGL failed but was tried again later. The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly uninitialized data structure if loading the library first failed. A later try to use EGL then skipped initialization and assumed it was previously successful because the data structure now already existed. This led to at least one crash in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was dereferenced to make a call to eglBindAPI().
Ryan C. Gordon 7232e51a 2015-06-08T01:52:43 Unix: Don't send quit events during signal handler. Make note to send it, and send next time we SDL_PumpEvents(). Otherwise, we might be trying to use malloc() to push a new event on the queue while a signal is interrupting malloc() elsewhere, usually causing a crash. Fixes Bugzilla #2870.
Sam Lantinga 2c4a6ea0 2015-05-26T06:27:46 Updated the copyright year to 2015
Ryan C. Gordon b72938c8 2015-04-20T12:22:44 Windows: Always set the system timer resolution to 1ms by default. An existing hint lets apps that don't need the timer resolution changed avoid this, to save battery, etc, but this fixes several problems in timing, audio callbacks not firing fast enough, etc. Fixes Bugzilla #2944.
Alex Szpakowski fe6c797c 2015-04-10T23:30:31 Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
Ryan C. Gordon 87ef19c4 2015-03-25T10:19:10 Keep track of maximum number of events in-flight in the SDL queue at once.
Edward Rudd b88ca1b4 2015-02-10T16:28:56 the last parameter of XChangeProperty is the number of elements.. and when the element format is 32.. the element is "long" so we have 5 long elements here. Yes this seems confusing as on mac+linux Long is either 32 or 64bits depending on the architecture, but this is how the X11 protocol is defined. Thus 5 is the correct value for the nelts here. Not 5 or 10 depending on the architecture. More info on the confusion https://bugs.freedesktop.org/show_bug.cgi?id=16802
Philipp Wiesemann b48e54aa 2015-01-26T22:00:29 Fixed bug 2802 - [patch] Fix android build compiling in wrong filesystem implementation Jonas Kulla The configure script didn't differentiate between Linux and Android, unconditionally compiling in the unix implementation of SDL_sysfilesystem.c. I'm probably one of the very few people building SDL for android using classic configure + standalone toolchain, so this has gone undetected all along.
David Ludwig 70438be2 2014-12-03T10:55:23 WinRT: fixed bug whereby SDL would override an app's default orientation WinRT apps can set a default, preferred orientation via a .appxmanifest file. SDL was overriding this on app startup, and making the app use all possible orientations (landscape and portrait). Thanks to Eric Wing for the heads up on this!
Philipp Wiesemann 9c398852 2014-11-22T22:20:40 Corrected header file documentation comment.
Pierre-Loup A. Griffais 24c86b55 2014-09-11T19:24:42 [X11] Reconcile logical keyboard state with physical state on FocusIn since the window system doesn't do it for us like other platforms. This prevents sticky keys and missed keys when going in and out of focus, for example Alt would appear to stick if switching away from an SDL app with Alt-Tab and had to be pressed again. CR: Sam
Sam Lantinga 553028c9 2014-06-22T11:02:56 Partial fix for bug 2556 - add compilation flag -Wshadow I added -Wshadow and then turned it off again because of massive variable shadowing in the blit macros. Feel free to go through that code and fix these if you want. Just uncomment CheckWarnShadow in configure.in if you want to try this.
Ryan C. Gordon 446d19c4 2014-06-14T23:31:23 Removed SDL_SYS_JoystickNeedsPolling(). It was simpler to just have the polling (actually: hotplug detection) functions return immediately if it's not an appropriate time to poll. Note that previously, if any joystick/controller was opened, we would poll every time anyhow, skipping this function.
Sam Lantinga 52222db2 2014-05-31T11:33:25 Fixed SDL error when filtering events after shutdown. This can happen when restoring video modes during video system shutdown
David Ludwig 3dcb451f 2014-04-09T21:29:19 Added a README file regarding WinRT support To note, this file is currently formatted with CRLF line endings, rather than LF, to allow the file to be viewed with Notepad.
Sam Lantinga 5512eac6 2014-02-22T15:27:11 Fixed bug 2414 - Execute event watchers in the order they were added Leonardo Event watchers are being executed on the inverse order they are added because they are added to the head of the SDL_event_watchers list. Since watchers are allowed to change events before they are reported (they shouldn't, imo), this breaks code that rely on watcher execution order (such as distributed event handling). An easy scenario to see this behaving weird to the user is if you add an event watcher to check mouse coordinates and check them again in your event loop. If you add the watcher after renderer's one (which always happens after you have initialized renderer), you get the same event but different coordinates. The proposed patch adds the event watcher in the tail of the list, not in the beginning, and correctly fixes this problem.
Sam Lantinga 58edac3e 2014-02-02T00:53:27 Fixed bug 2374 - Update copyright for 2014... Is it that time already??
Gabriel Jacobo f848adff 2013-11-29T10:06:08 Improve Android pause/resume behavior.
Ryan C. Gordon 7e1289af 2013-11-24T23:56:17 Make internal SDL sources include SDL_internal.h instead of SDL_config.h The new header will include SDL_config.h, but allows for other global stuff.
Sam Lantinga 08fa8da7 2013-10-20T21:56:15 Fixed bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings Andreas Ertelt The problem in question is caused by changeset 7771 (http://hg.libsdl.org/SDL/rev/5486e579872e / https://bugzilla.libsdl.org/show_bug.cgi?id=2121) The redefinition of __inline__ (introduced by the addition of begin_code.h:128's "|| __STRICT_ANSI__") results in mingw's gcc throwing multiple warning: always_inline function might not be inlinable [-Wattributes] as well as a whole bunch of redefinitions of mingw internals which break linking of projects including the SDL2 headers.
Sam Lantinga f5fa492e 2013-10-20T20:42:55 Added a macro SDL_TICKS_PASSED() to correctly compare two 32-bit tick values. Went through the code and used the macro and fixed a couple places that were using incorrect timestamp comparisons.
Sam Lantinga f79fc33a 2013-08-29T08:29:21 Christoph Mallon: Remove pointless if (x) before SDL_free(x)
Gabriel Jacobo dad42067 2013-08-12T11:13:50 Fixes #2022, do not resume on Android when surfaceChanged If the app is in landscape mode and the user presses the power button, a pause is followed immediately by a surfaceChanged event because the lock screen is shown in portrait mode. This triggers a "false" resume. So, we just pause and resume following the onWindowFocusChanged events. Also, wait for SDL_APP_WILLENTERBACKGROUND and SDL_APP_DIDENTERBACKGROUND before blocking the event pump.
Sam Lantinga 1ad936eb 2013-08-11T19:56:43 Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() Rainer Deyke I'm running Linux Mint 15 with the Cinnamon window manager. SDL_DestroyWindow consistently locks up for me when the window if fullscreen.