Commit Graph

20 Commits

Author SHA1 Message Date
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
Ryan C. Gordon
7a9b9e05e0 SDL_mouse.c doesn't need default_cursor.h. 2017-08-17 20:47:16 -04:00
Sam Lantinga
a4cfa93670 Fixed bug 2293 - Precise scrolling events
Martijn Courteaux

I implemented precise scrolling events. I have been through all the folders in /src/video/[platform] to implement where possible. This works on OS X, but I can't speak for others. Build farm will figure that out, I guess. I think this patch should introduce precise scrolling on OS X, Wayland, Mir, Windows, Android, Nacl, Windows RT.

The way I provide precise scrolling events is by adding two float fields to the SDL_MouseWheelScrollEvent datastructure, called "preciseX" and "preciseY". The old integer fields "x" and "y" are still present. The idea is that every platform specific code normalises the scroll amounts and forwards them to the SDL_SendMouseWheel function. It is this function that will now accumulate these (using a static variable, as I have seen how it was implemented in the Windows specific code) and once we hit a unit size, set the traditional integer "x" and "y" fields.

I believe this is pretty solid way of doing it, although I'm not the expert here.

There is also a fix in the patch for a typo recently introduced, that might need to be taken away by the time anybody merges this in. There is also a file in Nacl which I have stripped a horrible amount of trailing whitespaces. (Leave that part out if you want).
2017-08-14 21:28:04 -07:00
Sam Lantinga
de91b1248f Fixed bug 3745 - specify SDLCALL as the calling convention for API callbacks
Patches contributed by Ozkan Sezer
2017-08-14 06:28:21 -07:00
Sam Lantinga
bfd5a13473 Fixed bug 2931 - Large relative mouse motion jumps when using touch input 2017-08-12 20:25:49 -07:00
Sam Lantinga
56cab6d452 Added a hint SDL_HINT_TOUCH_MOUSE_EVENTS to control whether touch events generate synthetic mouse events. 2017-08-03 09:48:44 -07:00
Ryan C. Gordon
61a3ba303c Replaced a few single-line "//" comments. 2017-01-07 17:09:14 -05:00
Sam Lantinga
45b774e3f7 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga
54188c8b9e Fixed crash at startup 2016-12-03 09:59:43 -08:00
Sam Lantinga
16074e6749 Fixed compile warning on Visual Studio 2016-12-02 22:18:05 -08:00
Sam Lantinga
4eda58ba6a Added SDL_HINT_MOUSE_NORMAL_SPEED_SCALE and SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE to scale the speed of the mouse.
This currently doesn't affect absolute motion, which would need to be implemented on each windowing system so the cursor matches the reported mouse coordinates.
2016-12-02 21:01:13 -08:00
Sam Lantinga
57d01d7d67 Patch from Sylvain to fix clang warnings 2016-11-13 22:57:41 -08:00
Sam Lantinga
27d4f09929 Implemented SDL_GetHintBoolean() to make it easier to check boolean hints 2016-10-07 23:40:44 -07:00
Philipp Wiesemann
7b23eef3b0 Fixed crash if allocating memory for mouse clicks failed. 2016-09-30 23:30:54 +02:00
Alex Szpakowski
450fa8cdf9 Use OS-provided click counts on macOS and iOS for mouse press and release events. 2016-09-24 18:46:34 -03:00
Sam Lantinga
42065e785d Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Ryan C. Gordon
e346f14277 SDL_WarpMouseGlobal() should return non-void.
There are platforms it isn't implemented on (and currently can't be
implemented on!), and there's currently no way for an app to know this.

This shouldn't break ABI on apps that moved to a revision between 2.0.3 and
2.0.4.
2015-07-17 21:03:58 -04:00
Philipp Wiesemann
0e45984fa0 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().
2015-06-21 17:33:46 +02:00