Commit Graph

203 Commits

Author SHA1 Message Date
Cameron Gutman
a559864968 x11/wayland: Fix signal handling while blocking in WaitEventTimeout()
Add a new flag to avoid suppressing EINTR in SDL_IOReady(). Pass the
flag in WaitEventTimeout() to ensure that a SIGINT will wake up
SDL_WaitEvent() without another event coming in.
2021-10-30 21:23:45 -07:00
Cameron Gutman
ac54d57aa5 event: Check subsystem initialization before events or devices
SDL_WasInit() is cheaper SDL_NumJoysticks()/SDL_NumSensors().
2021-10-27 22:35:56 -05:00
Cameron Gutman
1bc6dc3ea0 event: Cap maximum wait time if sensor or joystick subsystems are active
Joystick and sensor subsystems require periodic polling to detect new devices.
2021-10-27 22:35:56 -05:00
Cacodemon345
19dee1cd16
Add SDL_GetWindowICCProfile(). (#4314)
* Add SDL_GetWindowICCProfile

* Add new SDL display events

* Implement ICC profile change event for macOS

* Implement ICC profile notification for Windows

* Fix SDL_GetWindowICCProfile() for X11

* Fix compile errors
2021-10-21 17:37:20 -07:00
Sam Lantinga
d5700ed20b Don't log SDL_POLLSENTINEL, it's purely for internal bookkeeping 2021-10-15 00:01:39 -07:00
Sam Lantinga
dd5d89505d Fixed whitespace 2021-10-14 23:53:41 -07:00
Brick
8bf32e12d8
Improved SDL_PollEvent usage (#4794)
* Avoid unnecessary SDL_PumpEvents calls in SDL_WaitEventTimeout

* Add a sentinel event to avoid infinite poll loops

* Move SDL_POLLSENTINEL to new internal event category

* Tweak documentation to indicate SDL_PumpEvents isn't always called

* Avoid shadowing event variable

* Ignore poll sentinel if more (user) events have been added after

Co-authored-by: Sam Lantinga <slouken@libsdl.org>
2021-10-14 22:26:10 -07:00
Sam Lantinga
88e9f7765c Fixed relative mouse mode using warping after 82793ac279 2021-10-14 18:37:27 -07:00
Sam Lantinga
82793ac279 Fixed mouse warping while in relative mode
We should get a mouse event with an absolute position and no relative motion and shouldn't change the OS cursor position at all
2021-10-14 14:26:21 -07:00
Sam Lantinga
1fa154fda3 Fix weak enforcement of timeouts in SDL_WaitEventTimeout_Device. This will loop pumping events and waiting for a system event to come in. However not all system events will turn into an SDL event. It's not unusual for a Windows message to be some internal thing that SDL doesn't convert into a message. In that case the loop will simple circle but not exit. As long as such messages are coming in the loop will continue to run regardless of the timeout. When messages finally stop it'll still wait for the full timeout so you can have arbitrarily long delays.
Instead do an absolute elapsed time check since the start of the wait.  If that is exceeded during any iteration the routine exits as the timeout has elapsed.
2021-10-13 09:33:54 -07:00
Sam Lantinga
1ec409c214 Don't warp the mouse within a window while it's minimized 2021-10-06 09:09:09 -07:00
Ethan Lee
7ed415d2ed wayland: Reuse KeySymToUcs4 to replicate X11 keymap behavior 2021-09-23 11:50:47 -07:00
David Gow
fbc364908a Use the new SDL_clamp() macro where sensible
There were a few places throughout the SDL code where values were
clamped using SDL_min() and SDL_max(). Now that we have an SDL_clamp()
macro, use this instead.
2021-08-14 09:01:14 -07:00
Sam Lantinga
694771513c Get the window size for the window receiving the mouse motion
This is the mouse focus except in the case where relative motion is enabled and the mouse is over a window floating on top of the application window (e.g. the taskbar)
2021-08-14 00:00:57 -07:00
Sam Lantinga
6a1e1ed9ae Relative mouse mode grab is based on the window with the input focus
This fixes restoring the cursor clip rectangle after the mouse has moved off of the window.

Also try to better synchronize cursor visibility with mouse position changes when changing relative mode. This doesn't work perfectly, but it seems to improve things on Windows.
2021-08-14 00:00:57 -07:00
Sam Lantinga
b28ed02803 Don't warp the mouse for relative mode when the window doesn't have focus 2021-08-13 11:39:41 -07:00
Sam Lantinga
cb1e20b058 Added KMOD_SCROLL to track the scroll lock state
Fixes https://github.com/libsdl-org/SDL/issues/4566
2021-08-10 17:50:17 -07:00
Dean Herbert
8fb95034e8 Avoid warping the cursor to the center of the window when not in relative_warp_mode
When relative mode is enabled and not using warp mode, the cursor is
being clipped to the window. Therefore there is no reason to restore the
cursor position to the center.

Avoiding the warp to center simplifies mouse position event flow, as we
are no longer potentially receiving mouse events for the automated
movement of the cursor and can be (mostly) assured that an incoming
event from the windowing system is that of external means.
2021-07-08 09:27:09 -07:00
Cameron Gutman
7948c16df2 Pump events each time through the loop in SDL_WaitEventTimeout_Device()
Not only is it more efficient to batch process pending events, it is
necessary for correctness with the Win32 backend. WIN_PumpEvents() runs
periodic updates of the cursor clip region and disambiguation of
left and right shift keys in addition to standard event processing.
2021-06-24 12:14:17 -07:00
Cameron Gutman
105de64c2d Only queue one wakeup event per wait
Queuing more than one can lead to a spurious wakeup on the next wait.
2021-06-24 12:14:17 -07:00
Ozkan Sezer
d28437de3c SDL_keyboard.c: Add bounds guards when assigning to the scancode array.
Based on a patch by Jochen Schäfer <josch1710@live.de> :
On a T420 pressing the ACPI button for volume control, big scancodes
were emitted. This was causing an overflow, because missing guards.
2021-06-12 08:00:50 +03:00
Cameron Gutman
e13b43ac21 Don't skip sending wakeups for the current thread
We can be in a situation where we receive a win32 hook callback on the same
thread that is currently waiting. In that case, we do still need to trigger
a wakeup when an event is pushed because the hook itself won't necessarily
do that (depending on what we return from the hook).
2021-06-05 14:35:21 -07:00
Cameron Gutman
b992b915e5 Optimize SDL_WaitEventTimeout() for the SDL_PollEvent() case
There's no sense in doing all the setup for waiting if we're just polling.
2021-06-05 14:35:21 -07:00
Cameron Gutman
85b51e6c92 Fall back to polling normally if not operating the win32 message loop
In this condition, we cannot safely wait/wake on events.
2021-06-05 14:35:21 -07:00
Cameron Gutman
e13d5df00b Call SDL_SendWakeupEvent() directly from SDL_PeepEvent()
SDL_PeepEvent() is a documented public API, so we must properly support
waking a waiting thread in SDL_WaitEventTimeout() with SDL_PeepEvent().
2021-06-05 14:35:21 -07:00
Francesco Abbate
0dd7024d55 Modifies WaitEvent and WaitEventTimeout to actually wait instead of polling
When possible use native os functions to make a blocking call waiting for
an incoming event. Previous behavior was to continuously poll the event
queue with a small delay between each poll.

The blocking call uses a new optional video driver event,
WaitEventTimeout, if available. It is called only if an window
already shown is available. If present the window is designated
using the variable wakeup_window to receive a wakeup event if
needed.

The WaitEventTimeout function accept a timeout parameter. If
positive the call will wait for an event or return if the timeout
expired without any event. If the timeout is zero it will
implement a polling behavior. If the timeout is negative the
function will block indefinetely waiting for an event.

To let the main thread sees events sent form a different thread
a "wake-up" signal is sent to the main thread if the main thread
is in a blocking state. The wake-up event is sent to the designated
wakeup_window if present.

The wake-up event is sent only if the PushEvent call is coming
from a different thread. Before sending the wake-up event
the ID of the thread making the blocking call is saved using the
variable blocking_thread_id and it is compared to the current
thread's id to decide if the wake-up event should be sent.

Two new optional video device methods are introduced:

WaitEventTimeout
SendWakeupEvent

in addition the mutex

wakeup_lock

which is defined and initialized but only for the drivers supporting the
methods above.

If the methods are not present the system behaves as previously
performing a periodic polling of the events queue.

The blocking call is disabled if a joystick or sensor is detected
and falls back to previous behavior.
2021-06-04 13:50:50 -07:00
Ankith
07fc1bb883 Fix invalid UTF-8 handling of extra bytes 2021-03-16 18:51:28 -07:00
Cameron Gutman
79cd8cab08 Add default handler for Alt+Tab while keyboard grab is enabled
By default, we will minimize the window when we receive Alt+Tab with a
full-screen keyboard grabbed window to allow the user to escape the
full-screen application.

Some applications like remote desktop clients may want to handle Alt+Tab
themselves, so provide an opt-out via SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED=0.
2021-02-10 10:22:18 -05:00
Sylvain Becker
68815b6c06 Fixed bug 5465 - Invalid memcpy inside SDL_GestureDelTouch (Thanks dmikushin and Yuki Okumura) 2021-01-10 22:21:12 +01:00
Sam Lantinga
9130f7c377 Updated copyright for 2021 2021-01-02 10:25:38 -08:00
Sam Lantinga
5f7cd1fa88 Added hints to control whether SDL updates joystick and sensor state in the main event loop 2020-12-18 10:08:59 -08:00
Sam Lantinga
cb36189692 Fixed bug 5235 - All internal sources should include SDL_assert.h
Ryan C. Gordon

We should really stick this in SDL_internal.h or something so it's always available.
2020-12-09 07:16:22 -08:00
Ozkan Sezer
d27238751f os2: integrate the port into main tree. 2020-10-14 23:01:06 +03:00
Sam Lantinga
bcbaa4ec1f If there isn't a GetGlobalMouseState() implementation, fall back to the normal one. 2020-05-26 16:34:50 -07:00
Ryan C. Gordon
fa23e3d00b 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.
2020-05-04 02:27:29 -04:00
Sam Lantinga
d4f1b520c9 Added support for press/release hardware keyboard events in iOS 13.4 2020-04-08 19:16:31 -07:00
Sam Lantinga
1f4965c8c4 Fixed warnings building with mingw64 2020-03-08 21:24:06 -07:00
Sam Lantinga
997f3e9e82 Fixed build warnings 2020-03-02 09:03:55 -08:00
Sam Lantinga
b5849daf3e Fixed build warnings on Android 2020-02-01 09:23:04 -08:00
Sam Lantinga
a8780c6a28 Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
Sam Lantinga
dd7fe0af08 Fixed bug 4814 - Missing scancodes on Linux
Michael Roe

The mappings for keyboard scancodes on Linux do not include keypad left and right parentheses (used on some Microsoft keyboard), keypad plus/minus, LANG1 and LANG2 (used on Korean keyboards), XK86MenuKB, and F20 (remapped to Audio Mic Mute in the usual X11 config).
2019-11-16 22:45:49 -08:00
Sam Lantinga
cf33f1f0ef Added a utility function to simplify the hint handling logic 2019-11-13 21:53:01 -08:00
Sylvain Becker
b458d7a28f Readability: remove redundant cast to the same type 2019-10-30 15:13:55 +01:00
Cameron Gutman
31ee4d3d81 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.
2018-11-03 15:46:42 -07:00
Sam Lantinga
526b9bdf1c Backed out changeset b0241180cdc5
Better commit incoming!
2019-10-14 22:41:27 -07:00
Ryan C. Gordon
cd8652d8f3 events: SDL_WaitEvent()'s polling loop now sleeps 1ms instead of 10ms.
Fixes Bugzilla #4356.
2019-10-15 01:13:44 -04:00
Ryan C. Gordon
cf092eca90 mouse: Save initial position yet even if xrel and yrel are 0.
The X11 target sets mouse->last_x and last_y in EnterNotify and then calls
SDL_SendMouseMotion(), which throws away the new position because it matches
the mouse->last_x and last_y we just set, meaning that if the pointer is
in the window when it created, SDL_GetMouseState() will report a position of
0,0 until a MotionNotify event (the pointer moves) arrives and corrects the
mouse state.

Mostly fixes Bugzilla #1612.
2019-10-09 13:42:13 -04:00
Sylvain Becker
70dc8d1648 Android: fix corresponding warnings 2019-08-30 08:55:20 +02:00
Sylvain Becker
2cb26188e1 Fixed bug 1663 - SDL_EventState(SDL_DOLLARGESTURE,SDL_IGNORE) etc. has no effect 2019-08-24 20:40:37 +02:00
Sylvain Becker
2937317f12 Fixed bug 4172 - remove logging Gesture error "NumPoints = 0"
- not necessary when app isn't recording gesture.
- happen when gesture path has less than 2 different points
2019-08-22 10:15:33 +02:00
Alex Szpakowski
d5ec735a33 Add a windowID field to SDL_TouchFingerEvent (bug #4331).
This is unimplemented on some platforms and will cause compile errors when building those platform backends for now.
2019-08-01 18:22:12 -03:00
Sam Lantinga
e7c2cf107a Fixed bug 4704 - SDL_HINT_ANDROID_SEPERATE_MOUSE_AND_TOUCH on Windows?
superfury

I notice that, somehow, when locking the mouse into place(using SDL_SetRelativeMouseMode), somehow at least the movement information gets through to both mouse movement and touch movement events?

My app handles both, so when moving a touched finger accross the app(using RDP from an Android device) I see the mouse moving inside the app when it shouldn't(meaning that the touch movement is ignored properly by the app(press-location dependant) but the mouse movement is still performed due to the mouse movement events)?
2019-07-15 09:36:53 -07:00
Sylvain Becker
6625203514 SDL_Mouse/Touch: discard synthetic events when hints are not set.
Those are generated/flagged by platform layer.
2019-07-09 11:46:42 +02:00
Ryan C. Gordon
e841b066fd cocoa: Another attempt at mouse vs touch support.
This time, we make anything we think is a MacBook trackpad report its touches
as SDL_MOUSE_TOUCHID, even though they're not _actually_ synthesized events,
and let all mouse input--even if the OS synthesized it from a multitouch
trackpad on our behalf--look like physical input. This is backwards from
reality, but produces the results most apps will expect.

Note that if you have a real touch device that doesn't appear to be the
trackpad, it'll produce real touch events with unique device ids, so it's
not a total loss here, but also note that the way we decide if it was the
trackpad is an imperfect heuristic; it happens to work out right now, but
it's not impossible that a real touchscreen could come to the Mac at some
point and (incorrectly?) call it a "mouse" input, etc.

But for now, good enough.

Fixes Bugzilla #4690.
2019-07-08 13:41:01 -04:00
Sam Lantinga
f3226457e0 Fixed bug 4672 - Warnings in SDL_LogEvent() 2019-06-19 17:11:20 -07:00
Sam Lantinga
8ab907baa6 Only warp the mouse to set focus if we're definitely going into relative mode 2019-06-18 14:24:26 -07:00
Alex Szpakowski
9306ef9b10 Fix synthetically generated mouse events getting lost forever after the device orientation changes (or the window is otherwise resized) while a finger is touching the screen. 2019-06-16 14:10:30 -03:00
Ryan C. Gordon
d9a2eff26f cocoa: Another attempt at synthesized mouse/touch events. 2019-06-13 21:31:03 -04:00
Ryan C. Gordon
294574647d cocoa: Revised synthesized mouse/touch event strategy.
I _think_ I understand what Sylvain is working on here now, so hopefully I
got this right.

Fixes Bugzilla #4576.

(I think!)
2019-06-13 01:57:13 -04:00
Sam Lantinga
e401b95025 Return an error if both mouse relative mode and mouse warping are unavailable, instead of asserting. 2019-05-23 11:32:36 -07:00
Sam Lantinga
62a5797088 Windows are not in a minimized state when they are shown
This fixes https://github.com/ValveSoftware/steam-for-linux/issues/4313
"Exiting game a in Steam Big Picture Mode gets semi-windowed BPM"
2019-05-15 14:01:15 -07:00
Sylvain Becker
aae49015da Fixed bug 4581 - generate synthetic mouse events at window boundaries
when real touch events are actually outside the window.
2019-04-10 10:59:53 +02:00
Sylvain Becker
cfefe5434a Fixed bug 4581 - mouse events with SDL_TOUCH_MOUSEID make window lost focus
Virtual mouse events should never leave the window or change focus for single window applications.
2019-04-08 21:27:24 +02:00
Sylvain Becker
eb7affeeb8 SDL_HINT_MOUSE_TOUCH_EVENTS: move tracking appart in case of 'window' is null 2019-04-06 21:52:51 +02:00
Sylvain Becker
a1a9fd50c6 Bug 4581: move tracking appart so it doesn't require the window to have focus 2019-04-06 21:43:16 +02:00
Sam Lantinga
9eac91dd29 Set SDL_HINT_MOUSE_TOUCH_EVENTS for iPhone and iPad as well 2019-04-05 08:10:12 -07:00
Sylvain Becker
b470cd9b09 Android: default SDL_HINT_MOUSE_TOUCH_EVENTS to 1 as previous behaviour 2019-04-05 08:36:31 +02:00
Sylvain Becker
e41576188d Add hint SDL_HINT_MOUSE_TOUCH_EVENTS for mouse events to generate touch events
controlling whether mouse events should generate synthetic touch events
By default SDL will *not* generate touch events for mouse events
2019-04-04 16:51:50 +02:00
Sylvain Becker
ab03892ddf Bug 4576: track both FingerId and TrackId 2019-04-04 15:19:00 +02:00
Sylvain Becker
e39c0a1f7d Bug 4576: fix wrong scaling 2019-04-03 10:14:42 +02:00
Sylvain Becker
b45abbb2a7 Bug 4576: fix warning and compile 2019-04-02 17:57:27 +02:00
Sylvain Becker
a3f2c446ef Bug 4576: handle mapping of TouchEvents to MouseEvents at higher level 2019-04-02 16:46:17 +02:00
Sam Lantinga
b8bd0aa0bd Fixed bug 4450 - SDL_mouse.c fails to compile with CMake generated Visual Studio files if SDL_VIDEO_VULKAN 0/undefined
Max Waine

SDL_mouse.c, if compiled for Windows, requires GetDoubleClickTime to compile (available from winuser.h). Without Vulkan present this fails to compile as the include chain for winuser.h is the following.

SDL_mouse.c -> SDL_sysvideo.h -> SDL_vulkan_internal.h -> SDL_windows.h -> windows.h -> winuser.h.
Problem is that SDL_vulkan_internal.h doesn't include SDL_windows.h if Vulkan isn't present, so under MinGW/GCC it will give a -Wimplicit-function-declaration warning for GetDoubleClickTime, and under MSVC fails to compile completely.

The solution to this would be to simplify the include chain: including SDL_windows.h under the same condition as GetDoubleClickTime (#ifdef __WIN32__) in SDL_mouse.c (or another file that isn't quite so indirectly included).
2019-03-16 19:07:34 -07:00
Ryan C. Gordon
12c5cda6bf Fix compiler warnings. 2019-03-16 00:08:19 -04:00
Ryan C. Gordon
f95ca7bb8e events: Disable all the signal-handling code on platforms without support.
So on Windows, for example, this mostly becomes a few empty functions.
2019-03-15 16:13:19 -04:00
Ryan C. Gordon
8a5a05c168 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.
2019-03-15 15:51:05 -04:00
Ryan C. Gordon
911bf6241b 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.
2019-03-15 14:08:30 -04:00
Sylvain Becker
28f54ee439 SDL_MouseQuit(): clear mouse->cur_cursor (Bug 4530) 2019-03-11 15:31:46 +01:00
Sam Lantinga
5e13087b0f Updated copyright for 2019 2019-01-04 22:01:14 -08:00
Sylvain Becker
c0c8f2d703 Gesture: remove warnings when ENABLE_DOLLAR is undefined. 2018-12-16 11:15:21 +01:00
Sam Lantinga
898644d18e Made it more clear that the values being compared are floats 2018-12-06 09:09:05 -08:00
Sylvain Becker
252dc85e95 Fix warnings detected on Android build 2018-12-06 09:22:00 +01:00
Alex Szpakowski
5029d50ea8 Add SDL_TouchDeviceType enum and SDL_GetTouchDeviceType(SDL_TouchID id).
Touch device types include SDL_TOUCH_DEVICE_DIRECT (a touch screen with window-relative coordinates for touches), SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE (a trackpad-style device with absolute device coordinates), and SDL_TOUCH_DEVICE_INDIRECT_RELATIVE (a trackpad-style device with screen cursor-relative coordinates).

Phone screens are an example of a direct device type. Mac trackpads are the indirect-absolute touch device type. The Apple TV remote is an indirect-relative touch device type.
2018-11-10 16:15:48 -04:00
Micha? Janiszewski
91820998fc Add and update include guards
Include guards in most changed files were missing, I added them keeping
the same style as other SDL files. In some cases I moved the include
guards around to be the first thing the header has to take advantage of
any possible improvements compiler may have for inclusion guards.
2018-10-28 21:36:48 +01:00
Ethan Lee
de9f5415b3 Filter both SIZE_CHANGED and RESIZED on any SIZE_CHANGED 2018-08-13 12:52:52 -04:00
Sam Lantinga
f8b4cd410b Re-enable drag-and-drop events by default 2018-09-30 19:53:26 -07:00
Sam Lantinga
6b3e893105 Added hints SDL_HINT_MOUSE_DOUBLE_CLICK_TIME and SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS to allow tuning double-click sensitivity.
Also increased the default double-click radius to 32 pixels to be more forgiving for touch interfaces
2018-09-14 19:26:26 -07:00
Sam Lantinga
50d5002533 Fixed build 2018-08-23 02:21:17 -07:00
Sam Lantinga
f225af0c1e Added SDL_GetDisplayOrientation() to get the display orientation, and added a new event SDL_DISPLAYEVENT to notify the application when the orientation changes.
Documented the values returned by the accelerometer and gyroscope sensors
2018-08-22 21:48:28 -07:00
Sam Lantinga
7c3040e08a First pass on the new SDL sensor API 2018-08-21 12:11:34 -07:00
Ryan C. Gordon
e061a92dc9 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.
2018-08-02 16:03:47 -04:00
Sam Lantinga
a515853569 Added support for external mouse in Samsung DeX mode
relative mode doesn't work, but absolute coordinates are functional
2018-06-18 13:14:02 -07:00
Sam Lantinga
2dedbc7262 Add Android support for relative mouse mode to SDL. 2018-06-05 12:46:11 -07:00
Sam Lantinga
330b19c968 Fixed building on platforms without __sighandler_t 2018-01-30 18:12:25 -08:00
Sam Lantinga
90e72bf4e2 Fixed ISO C99 compatibility
SDL now builds with gcc 7.2 with the following command line options:
-Wall -pedantic-errors -Wno-deprecated-declarations -Wno-overlength-strings --std=c99
2018-01-30 18:08:34 -08:00
Sam Lantinga
e3cc5b2c6b Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga
ca7297668a 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'.
2017-12-12 16:10:20 -08:00
Ryan C. Gordon
5cc46f3d30 mouse: remove assert for unimplemented platforms (thanks, tomwardio!).
Fixes Bugzilla #3946.
2017-11-06 15:29:24 -05:00
Sam Lantinga
a223560a7f Fixed bug 3880 - X Error upon quit since rev. 11607
Ozkan Sezer

Since changeset 11607:60cd425a2f14, I am getting the following
error upon quit.  Running testsprite2, clicking the mouse, and
quiting it is enough to trigger it.  This is on my old Fedora9
x86-Linux:

X Error of failed request:  BadCursor (invalid Cursor parameter)
  Major opcode of failed request:  2 (X_ChangeWindowAttributes)
  Resource id in failed request:  0xb057340
  Serial number of failed request:  905
  Current serial number in output stream:  906

Reverting  https://hg.libsdl.org/SDL/rev/60cd425a2f14  removes
the error.
2017-10-13 19:30:34 -07:00
Sam Lantinga
1887c54c68 Fixed memory leak in Cocoa mouse code
The video quit call cleans up the mouse cursor driver data, which happens after mouse quit
2017-10-12 13:28:48 -07:00