Log

Author Commit Date CI Message
Sam Lantinga 33ed20fa 2015-06-16T22:16:35 Fixed bug 2774 - Android: screen distorted in Landscape after background/foreground Sylvain With a Landscape application. Going to background with Home Key, then foreground. The screen is distorted. This has been reported by Samsung. It happens on S5 and Samsung Alpha, see the video attached. I have captured the following logcat: V/SDL (20549): onResume() V/SDL (20549): surfaceCreated() V/SDL (20549): surfaceChanged() V/SDL (20549): pixel format RGB_565 V/SDL (20549): Window size:1920x1080 I/SDL (20549): SDL_Android_Init() I/SDL (20549): SDL_Android_Init() finished! V/SDL (20549): SDL audio: opening device V/SDL (20549): SDL audio: wanted stereo 16-bit 22.05kHz, 256 frames buffer V/SDL (20549): SDL audio: got stereo 16-bit 22.05kHz, 1764 frames buffer V/SDL (20549): onWindowFocusChanged(): true V/SDL (20549): onWindowFocusChanged(): false V/SDL (20549): onPause() V/SDL (20549): nativePause() V/SDL (20549): surfaceDestroyed() Background / Foreground V/SDL (20549): onResume() V/SDL (20549): surfaceCreated() V/SDL (20549): surfaceChanged() V/SDL (20549): pixel format RGB_565 V/SDL (20549): Window size:1080x1920 V/SDL (20549): surfaceChanged() V/SDL (20549): pixel format RGB_565 V/SDL (20549): Window size:1920x1080 V/SDL (20549): onWindowFocusChanged(): true V/SDL (20549): nativeResume() This seems to be related to the fact that I have in "AndroidManifest.xml": android:configChanges="..." Because of the fields: "orientation" and also "screenSize". I have looked for another way to solve the issue. Discarding the "surfaceChanged" call, based on the "requestedOrientation" and the new Orientation. It seems to be better. On my failing test case, the first "surfaceChanged()" is discarded. Sometimes the "focusChanged()" might appear between the two "surfaceChanged()", while the surface is not yet ready. Thus, discarding also the "nativeResume()". So, for robustness, a call to "nativeResume()" is added at the end of "surfaceChanged()". Some update: 1/ First I tried, to discard the surface using the current orientation (rather than width / heigh). -> that solve the issue sometimes, but not always. 2/ Samsung Certification now accepts my application that were previously failing. 3/ I personally now owns a Samsung S5, and was able to solve the issue on my side. 4/ I now use the patch and get no complaints from my users. (but I admit, nobody seemed to be complaining before neither...). 5/ I have added a v2 because of a new smart-phone called "Black Berry Passport" that has a square screen of 1440x1440. This screen has a "status bar" so the resolution is in fact : 1440x1308. (as reported by "surfaceChanged"). Problem is: the portrait resolution is in fact a Landscape! So the "v1" patch is always discarding the "surface" of BlackBerry Passport. Which is terribly bad. Hence, I added the "v2" patch not to discard the surface when aspect ratio is < 1.20. (BB 1440/1308 is : 1.1009). Which seems fair.
Philipp Wiesemann d29812d0 2015-06-16T20:28:21 Moved entry in WhatsNew.txt because it was already in 2.0.0 for Android and iOS.
Philipp Wiesemann 58efd8e5 2015-06-16T20:27:01 Fixed comment in test program.
Philipp Wiesemann ae60afce 2015-06-16T20:25:53 Excluded SDL_egl.h from doxygen input.
Sam Lantinga 59d34bc3 2015-06-15T23:44:08 Fixed bug 3015 - grab mouse inconsistent state Martin Gerhardy Not sure - but I think there might be a logic flaw in SDL_SetWindowGrab. The problem here is that this modifies the window flags and e.g. sets SDL_WINDOW_INPUT_GRABBED - but the _this->grabbed_window pointer is not yet set. Then in SDL_UpdateWindowGrab the _this->grabbed_window pointer is only set if the function pointer _this->SetWindowGrab is not NULL. But if this is NULL, the _this->grabbed_window pointer is never set, but every future call to any of the grab functions include an assert for: SDL_assert(!_this->grabbed_window || ((_this->grabbed_window->flags & SDL_WINDOW_INPUT_GRABBED) != 0)); That means the first call works, the second always fails and triggers the assert.
Ryan C. Gordon 0c3830a9 2015-06-16T00:57:45 Haptic/Linux: Keep track of device numbers properly to track duplicates. Fixes Bugzilla #3014.
Colby Klein ccc12a36 2015-06-15T20:24:51 Implement repositioning the OS-rendered IME with SDL_SetTextInputRect on Windows.
Sam Lantinga d7975823 2015-06-14T19:26:20 Fixed style
Sam Lantinga 34634082 2015-06-14T19:25:12 Fixed bug 3012 - Android accelerometer joystick axis values overflow when values from Android are larger than gravity Magnus Bjerke Vik This causes issues when for instance using the joystick API to make an Android phone rotate an object by rotating the phone. When the absolute value of an axis reported by android is larger than earth gravity, SDL will overflow the Sint16 value used for joystick axes, causing sporadic movements when close to the gravity. Just holding the phone so that e.g. Y points directly upwards will make it unstable, and even more if you just tap the phone gently from below (increasing the acceleration). More detailed: SDLActivity gets the accelerometer values in onSensorChanged and divides each axis by earth gravity. SDL_SYS_JoystickUpdate takes each of the axis values, multiplies them by 32767.0 (largest Sint16), and the casts them to Sint16. From this you can see that any value from Android that exceeds earth gravity will overflow the joystick axis. A fix is to clamp the values so that they won't overflow the Sint16.
Sam Lantinga e3df6d5e 2015-06-14T19:21:13 Fixed bug 2953 - Crash due to a bad cleanup in the SDL_SYS_HapticQuit function Technically this is caused by the haptic devices not being closed at quit time, which we need to fix anyway, but this is a bandaid for now.
Sam Lantinga a4eb0dea 2015-06-14T19:10:51 Fixed bug 2908 - Fix clang warnings Simon Deschenes My build system still shows warning as errors. The first warning says that the member named instances can never be false (or NULL) as it is a static array, and we should check for instances[index] which we do anyway.
Sam Lantinga 564ece51 2015-06-14T18:57:05 Only use explicit inlining - otherwise Visual Studio 2010 will inline SDL_zero(info) in SDL_vsnprintf() into a memset() call when compiling the Release x64 configuration.
Sam Lantinga c18e7724 2015-06-14T18:37:43 Fixed 2010 solution and removed Release_NoSTDIO build configuration
Sam Lantinga 4c484856 2015-06-14T18:21:04 Updated Visual Studio projects There is now a single solution used by Visual Studio 2010 and newer
David Ludwig 0c9da0c8 2015-06-14T20:15:36 WinRT: made sure build script generates Release-built binaries, by default winrtbuild.bat/.ps1 were generating Debug-built binaries, in some cases. This change makes sure that Release mode is the default.
Sam Lantinga 98f9b88c 2015-06-13T13:36:47 Fixed bug 3011 - pthread/SDL_syssem.c requires _GNU_SOURCE Ozkan Sezer pthread/SDL_syssem.c requires _GNU_SOURCE predefined (like SDL_sysmutex.c), otherwise sem_timedwait() prototype might not be available to it. Problem seen with glibc-2.3.4.
Sam Lantinga 9cf47d2f 2015-06-13T13:34:30 Fixed bug 3010 - SDL_x11messagebox.c needs including X11/keysym.h Ozkan Sezer SDL_x11messagebox.c needs including <X11/keysym.h> otherwise XK_Escape, etc might not be available to it. Seen this with x.org-x11-6.8.2.
Sam Lantinga 8b737fa8 2015-06-13T13:19:31 Updated WhatsNew.txt for 2.0.4
Sam Lantinga aee05522 2015-06-13T10:47:55 Fixed bug 3009 - Cannot compile SDL2 on Windows CMakeLists.txt was missing handling for running CMake with -DDIRECTX=0
Philipp Wiesemann d8c2b36c 2015-06-12T21:10:31 Fixed crash if allocation for touch device failed. If the allocation of an SDL_Touch failed, the number of touch devices was still increased. Later access of the SDL_Touch would then have dereferenced the NULL.
Ryan C. Gordon 71468742 2015-06-12T11:58:31 Make some string literals "const char *", not "char *" (thanks, Martin!). Fixes Bugzilla #3007.
Sam Lantinga f29de0d3 2015-06-11T12:04:57 Fixed bug 3005 - MOMO steering wheel not detected by SDL Joe Thompson This is a regression. The changes to fix #2460 cause the EnumJoysticksCallback() function to return without adding devices (Line 345 in SDL-0a2b6bc7005f\src\joystick\windows\SDL_dinputjoystick.c). Looking at dinput.h on my system, at least DI8DEVTYPE_DRIVING and DI8DEVTYPE_FLIGHT need to be added to the test. It might be better to check if (devtype == DI8DEVTYPE_SUPPLEMENTAL) rather than checking if it is NOT EQUAL to a long list of types. Or check if the device is already in the list.
Alex Szpakowski a86df3b7 2015-06-09T21:08:24 iOS: Fixed some cases where SDL_DestroyWindow or SDL_GL_DeleteContext can cause crashes.
Philipp Wiesemann cd1d7c94 2015-06-09T21:06:55 Wayland: Fixed SDL_GetTouchDevice() returning 0 for the valid device index. The single touch device gets SDL_TouchID 1 (like on Emscripten, iOS and WinRT).
Philipp Wiesemann 5d6aa08b 2015-06-09T21:06:29 Emscripten: Fixed SDL_GetTouchDevice() returning 0 for the valid device index. The single touch device gets SDL_TouchID 1 (like on iOS and WinRT).
Philipp Wiesemann 86e9ab79 2015-06-08T20:46:09 Linux: Fixed not needed call to close() on error. It was called if file descriptor was none and -1.
Ryan C. Gordon f1924a61 2015-06-08T03:07:24 Normalized endlines.
Ryan C. Gordon 69bef005 2015-06-08T03:07:16 Added LDFLAGS note to Raspberry Pi documentation (thanks, Michael!).
Ryan C. Gordon 50981d41 2015-06-08T02:58:46 x11: Drop duplicate XInput2 XI_RawMotion events. This happens when the pointer is grabbed, but it's not clear if this is a bug in x.org or my misunderstanding of the XGrabPointer() documentation. At any rate, we'll want to revisit this later for a better solution. Fixes Bugzilla #2963.
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.
Ryan C. Gordon 8283abdb 2015-06-08T01:17:58 Updated configure script.
Ryan C. Gordon e3f4ca0d 2015-06-08T01:13:51 configure/cmake/x11: Removed SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 test. This was the only thing that made SDL_config.h generate differently between 32 and 64-bit versions of Linux, so instead we force a function cast in our X11 code to match our dynamic loader version, which removes the compile error on some machines that prompted this test in the first place. Xlib never wrote to this data, so if you're on an older Xlib where this param wasn't const, your data should still be intact when we force the caller to think it was actually const after all. Fixes Bugzilla #1893.
Ryan C. Gordon f5dce3c6 2015-06-07T20:15:09 CMake: default to shared library builds being enabled.
Ryan C. Gordon d98cfe14 2015-06-07T20:00:20 Let's assume that if VS2005 and VS2010 do it, VS2008 probably does, too.
Ryan C. Gordon 753f95c5 2015-06-07T19:58:42 VS2005 tweaks (thanks, Ozkan!). Fixes Bugzilla #2895. His notes: The following trivial changes make SDL2 tree (mostly) compatible with Visual Studio 2005: * SDL_stdlib.c: Similar to VS2010 and newer, VS2005 also generates memcpy(), (it also generates memset(), see below), so propagate the #if condition to cover VS2005. * SDL_pixels.c (SDL_CalculateGammaRamp): VS2005 generates a memset() call for gamma==0 case, so replace the if loop with SDL_memset(). * SDL_windowsvideo.h: Include msctf.h only with VS2008 and newer, otherwise include SDL_msctf.h * SDL_windowskeyboard.c: Adjust the #ifdefs so that SDL_msctf.h inclusion is always recognized correctly.
Ryan C. Gordon 8bac7967 2015-06-07T18:29:23 Maybe patched to compile on some Windows configurations. (Maybe) Fixes Bugzilla #3001.
Ryan C. Gordon 141ac2b5 2015-06-07T17:59:31 Backed out changeset c6d43e08be34 This caused Bugzilla #2963, so we'll find a better solution.
Ryan C. Gordon 699f879a 2015-06-07T17:54:39 Fixed a memory leak (thanks, Zack!). We should probably rework this piece of code a little more after 2.0.4 ships, though. Fixes Bugzilla #3004.
Ryan C. Gordon 8a85084f 2015-06-06T22:45:22 RPi: Patched to compile without OpenGL (thanks, Simon!), other cleanups. Fixes Bugzilla #3003.
Philipp Wiesemann 5b2e7aab 2015-06-05T19:41:34 Fixed comments at conditional compilation macro in header file.
Philipp Wiesemann fd8b7c1c 2015-06-05T19:41:18 Fixed comments at conditional compilation macros.
Philipp Wiesemann c3186d5e 2015-06-05T19:40:50 Android: Added deactivated intent filter for testing drop file support.
Ryan C. Gordon f080ac3e 2015-06-04T19:05:01 Fixed docs path in RPM .spec file.
Ryan C. Gordon 360d05bf 2015-06-04T15:41:39 X11: Fixed SelectionRequest replies for target TARGETS. Fixes Google Chrome, etc, freezing up when SDL owns the clipboard selection and actually sends thems the correct text for pasting. Confirmed working with Unicode strings in UTF-8 format. There were a few tweaks in this patch, but the specific fix is that event.xselection.target in the SelectionNotify event we send back in reply must be set to the same atom as the request ("TARGETS" in this case), and we failed to do that in this special case. Things that don't ask for a target, like the Gnome Terminal app, worked fine because they don't ask for TARGETS and just go right to asking for a UTF8_STRING, and Mozilla apparently just was more liberal in what they accepted in reply. Chrome would reject our wrong reply and freeze up waiting for a valid one. Someone should fix that in Chrome, too. :) Fixes Bugzilla #2926.
Philipp Wiesemann 7738bd9b 2015-06-04T17:52:51 AIX: Fixed nearly impossible file descriptor leak.
Philipp Wiesemann eab076a7 2015-06-04T17:52:27 Fixed not needed calculation in test program.
Ryan C. Gordon 96aef8cb 2015-06-04T10:59:02 X11: Fixed compiler warnings in DEBUG_XEVENTS sections.
Sam Lantinga 38549a7b 2015-06-04T00:56:11 Fixed bug 2625 - Direct3D9 with SDL_TEXTUREACCESS_TARGET textures causes an application crash Roberto I have debugged the code checking the function calls when Direct3D is the renderer, remember that with software and OpenGL renderers, this issue is not happening. - Create the texture: SDL_Texture *pTex = SDL_CreateTexture(pRenderer, iFormat, SDL_TEXTUREACCESS_TARGET, pSurf->w, pSurf->h); - Update the texture: SDL_UpdateTexture(pTex, NULL, pSurf->pixels, pSurf->pitch); SDL_render.c, SDL_UpdateTexture(): return renderer->UpdateTexture(renderer, texture, rect, pixels, pitch); SDL_render_d3d.c, D3D_UpdateTexture(): if (D3D_UpdateTextureRep(data->device, &texturedata->texture, texture->format, rect->x, rect->y, rect->w, rect->h, pixels, pitch) < 0) { SDL_render_d3d.c, D3D_UpdateTextureRep(): if (D3D_CreateStagingTexture(device, texture) < 0) { SDL_render_d3d.c, D3D_CreateStagingTexture(): result = IDirect3DDevice9_CreateTexture(..., D3DPOOL_SYSTEMMEM, ...) --> FAIL! with INVALIDCALL code After checking a bit the Microsoft documentation, I found this: D3DUSAGE_RENDERTARGET can only be used with D3DPOOL_DEFAULT. (https://msdn.microsoft.com/en-us/library/windows/desktop/bb172625%28v=vs.85%29.aspx) The call that fails, is using D3DUSAGE_RENDERTARGET with D3DPOOL_SYSTEMMEM which is unsupported, hence the INVALIDCALL return code.
Ryan C. Gordon ba1263cd 2015-06-04T02:12:06 Backout commit 83034612a883 This caused 8-bit modes to be chosen on older OS X releases. Fixes Bugzilla #3000.
Ryan C. Gordon e8b376c9 2015-06-03T13:11:28 Linux: Implemented sysfs-based version of SDL_GetPowerInfo(). Fixes Bugzilla #2938.
Ryan C. Gordon 36ecb766 2015-06-01T01:25:22 Changed a static function to match the naming scheme of rest of source file.
Ryan C. Gordon 52df7f5b 2015-05-31T23:53:10 testmessage: Try Unicode chars in the title, too.
Ryan C. Gordon 05e78b3f 2015-05-31T22:59:59 X11: search all XI2 touch devices, not just masters (thanks, Volumetic!). Otherwise, you won't find touch devices that aren't currently assigned to a system cursor.
Ryan C. Gordon 554b2b0e 2015-05-31T22:48:26 X11: Fixed message boxes not responding to click on titlebar close button. The window needs to catch ClientMessage events for one specific window, but XNextEvent() catches everything, and XWindowEvent doesn't catch ClientMessage, so we need predicate procedure and XIfEvent() here. Fixes Bugzilla #2980.
Ryan C. Gordon cb60f2df 2015-05-31T22:27:46 testmessage.c should report when message boxes were closed.
Ryan C. Gordon 8bfc622b 2015-05-31T21:50:50 Fixed memory leaks in testfilesystem.c (thanks, Nitz!). Fixes Bugzilla #2991.
Ryan C. Gordon 7619ad34 2015-05-31T21:43:36 Cocoa: deal with mouse focus when warping the cursor from outside a window. Otherwise, you might not get appropriate mouse enter/leave events. Better fix for Bugzilla #2984.
Ryan C. Gordon 5b2ff76c 2015-05-31T13:58:36 Cocoa: send a MOUSEMOTION event when warping cursor from outside the window. Fixes Bugzilla #2984.
Philipp Wiesemann dbfd4fdd 2015-05-31T19:23:16 Android: Added missing space in three log messages. Also fixed a typo and changed tag string to constant.
Philipp Wiesemann 551fbf7b 2015-05-31T19:22:42 Android: Changed two unknown keys to be consistent with Windows and X11 mapping.
Ryan C. Gordon 80614b27 2015-05-31T11:38:10 Fixed swizzle of SDL_FillRect() on 24-bit surface (thanks, "nagydavid91"!). Fixes Bugzilla #2986.
Ryan C. Gordon 1899dfb0 2015-05-31T01:45:20 Fixed SDL_ISPIXELFORMAT_ALPHA to check pixel orders that match pixel type. Otherwise, SDL_PIXELFORMAT_BGR24 is reported as having alpha, because its SDL_ARRAYORDER_BGR pixel order uses the same integer value as SDL_PACKEDORDER_RGBA, since we weren't checking the pixel type to differentiate. Fixes Bugzilla #2977.
Ryan C. Gordon e58a5c43 2015-05-31T00:58:43 X11: Fixed high mouse buttons mappings and horizontal wheels (thanks, Daniel!). Fixes Bugzilla #2472.
Ryan C. Gordon 870df8ad 2015-05-31T00:50:30 Cocoa: ignore mouseDown events in a window's titlebar. These events accidentally slipping in sometimes appears to be a bug (or maybe new behavior) in 10.10, as previous versions of Mac OS X don't appear to ever trigger this. Thanks to Paulo Marques for pointing out the fix on the SDL mailing list! Fixes Bugzilla #2842 (again).
Philipp Wiesemann 8c9571a2 2015-05-29T22:24:38 Fixed typo in header file documentation comment.
Ryan C. Gordon f001a00b 2015-05-29T15:21:47 X11: Force the window focus during ShowWindow if there's no window manager. Fixes Bugzilla #2997.
Sam Lantinga c8881837 2015-05-28T19:06:07 Improved fix for bug 2096 - Mapping from scancode to keycode doesn't work for remapped modifier keys Zack Middleton The change to the keymap to use SDL_SCANCODE_TO_KEYCODE in SDL_x11keyboard.c causes all SDL scancodes without a Usc4 character to be XOR'd with SDLK_SCANCODE_MASK, but not all key code are suppose to be (as seen in include/SDL_keycodes.h). SDLK_BACKSPACE is not 0x4000002A. I think the full list of keys affected are return, escape, backspace, tab, and delete.
Sam Lantinga 45f967be 2015-05-28T18:57:57 Fixed building test programs on the iOS simulator
Sam Lantinga da190975 2015-05-28T18:57:10 Fixed clip rectangle calculation when there is a viewport offset
Sam Lantinga 6e67c949 2015-05-28T12:55:01 Fixed bug 2054 - SDL_GetError: "Unknown touch device" Volumetric The "Unknown touch device" message appears because the initial touch device setup loop uses SDL_GetTouch() as a guard for calling SDL_AddTouch(). SDL_GetTouch() will always report "Unknown touch device" since the device hasn't been added yet. The SDL_GetTouch() call is unnecessary since SDL_AddTouch() calls SDL_GetTouchIndex() to verify that the device hasn't been added yet, and SDL_GetTouchIndex() has the benefit of not reporting an error for a device it can't find.
Sam Lantinga 32d6dcdb 2015-05-28T12:48:20 Fixed bug 2096 - Mapping from scancode to keycode doesn't work for remapped modifier keys Jacob Lee If a user has a non-standard keyboard mapping -- say, their caps lock key has been mapped to Ctrl -- then SDL_GetModState() is no longer accurate: it only considers the unmapped keys. This is a regression from SDL 1.2. I think there are two parts to this bug: first, GetModState should use keycodes, rather than scancodes, which is easy enough. Unfortunately, on my system, SDL considers Caps Lock, even when mapped as Control, to be both SDL_SCANCODE_CAPSLOCK and SDLK_CAPSLOCK. The output from checkkeys for it is: INFO: Key pressed : scancode 57 = CapsLock, keycode 0x40000039 = CapsLock modifiers: CAPS Whereas the output for xev is: KeyPress event, serial 41, synthetic NO, window 0x4a00001, root 0x9a, subw 0x0, time 40218333, (144,177), root:(1458,222), state 0x10, keycode 66 (keysym 0xffe3, Control_L), same_screen YES, XKeysymToKeycode returns keycode: 37 XLookupString gives 0 bytes: XmbLookupString gives 0 bytes: XFilterEvent returns: False I think the problem is that X11_UpdateKeymap in SDL_x11keyboard.c only builds a mapping for keycodes associated with a Unicode character (anything where X11_KeyCodeToUcs returns a value). In the case of caps lock, SDL scancode 57 becomes x11 keycode 66, which becomes x11 keysym 65507(Control_L), which does not have a unicode value. To fix this, I suspect that SDL needs a mapping of the rest of the x11 keysyms to their corresponding SDL key codes.
Ryan C. Gordon 4d1626d0 2015-05-28T15:36:27 Windows SDL_GetBasePath: free string on failure.
Ryan C. Gordon aa43bee4 2015-05-28T15:32:45 Windows GetBasePath: fixed reallocation code.
Sam Lantinga f9abea20 2015-05-28T12:31:25 Fixed bug 2210 - Initializing Video produces unnecessary errors hiduei Overview: Initializing the Video Subsystem causes many errors though everything works as it should. Steps to Reproduce: 1) Set Loglevel to SDL_LOG_PRIORITY_ERROR 2) Initialize the Video Subsystem (SDL_Init(SDL_INIT_VIDEO)) Actual Results: Many errors (see attachment) are printed on stderr, then the application continues as expected. Expected Results: The errors should have been warnings at most.
Ryan C. Gordon 566316e0 2015-05-28T15:29:43 Windows SDL_GetBasePath: Fixed wrong variable when growing the buffer size.
Sam Lantinga 6a3ad8a9 2015-05-28T12:18:05 Fixed bug 2367 - Bad mouse motion coordinates with two windows where one has changed logical size Andreas Ragnerstam I have two windows where one has a renderer where the logical size has been changed with SDL_RenderSetLogicalSize. When I get SDL_MOUSEMOTION events belonging to the non-scaled window these will have been scaled with the factor of the scaled window, which is not expected. Adding some printf debugging to SDL_RendererEventWatch of SDL_render.c, where (event->type == SDL_MOUSEMOTION), I found that for every mouse motion SDL_RendererEventWatch is called twice and the event->motion.x and event.motion.y are set twice for the event, once for each renderer where only the last one set will be saved to the event struct. This will work fine if both renderers have the same scale, but otherwise the motion coordinates will be scaled for the renderer belonging to another window than the mouse was moved in. I guess one solution would be to check that window == renderer->window for SDL_MOUSEMOTION events, similar to what is done for when SDL_WINDOWEVENT events. I get the same error on both X11 and Windows. The same problem also exists for SDL_MOUSEBUTTONDOWN and SDL_MOUSEBUTTONUP events.
Sam Lantinga bccc2ad0 2015-05-28T12:06:48 Fixed compiling and tested on Windows
Ryan C. Gordon 75702ffe 2015-05-28T14:34:38 Make sure we have the vsscanf() prototype (thanks, Ozkan!). issue seen with glibc-2.8. Fixes Bugzilla #2721.
Sam Lantinga cb24f4de 2015-05-28T10:44:46 Fixed bug 2772 - SDL2 doesn't handle X KeymapNotify events Jason Wyatt Currently the keymapnotify event handling is commented out as FIXME in SDL_x11events.c (It looks like this may have functioned SDL1.2). Not handling this event means that if a window manager shortcut such as ALT+SPACE is used, SDL will send an ALT key down signal, but not an up signal. Also querying SDL about the key state, it believes the ALT key remains pressed. X passes the events keypress (alt), ?focusout?, ?focusin?, keymapnotify.
Sam Lantinga 719bb6fc 2015-05-28T09:52:48 Fixed X11 build, added code to print initial modifiers to checkkeys
Sam Lantinga 0694baf2 2015-05-28T09:33:47 Fixed bug 2736 - X11 doesn't set KMOD_NUM and KMOD_CAPS to system state Zack Middleton Using X11 (on Debian Wheezy), SDL_GetModState() & KMOD_NUM and KMOD_CAPS are not set to system state (numlock/capslock LEDs). Pressing numlock or capslock toggles the mod state, though if num/caps lock is enabled before starting the program it's still reversed from system state. This makes getting KMOD_NUM and KMOD_CAPS in programs unreliable. This can be seen using the checkkeys test program. The function that appears to have handle this in SDL 1.2 is X11_SetKeyboardState. The function call is commented out with "FIXME:" in SDL 2. Using Windows backend through WINE; on first key press if numlock and/or capslock is enabled on system, numlock/capslock SDL_SendKeyboardKey is run and toggles KMOD_NUM/KMOD_CAPS to the correct state. On X11 this does not happen. The attached patch makes X11 backend set keyboard state on window focus if no window was previously focused. It sets all keys to system up/down state and toggles KMOD_NUM/KMOD_CAPS via SDL_SendKeyboardKey to match system if needed. The patch is based on SDL 1.2's X11_SetKeyboardState.
Sam Lantinga 779d4035 2015-05-28T08:51:59 Fixed Windows build
Sam Lantinga 0669a224 2015-05-28T08:41:07 Fixed bug 2860 - SetProp must be paired with RemoveProp especially for properties added to external windows Coriiander Upon creating a window, a window property is added to it through the Win32-function "SetProp". This is done in the SDL-function "SetupWindowData" in file "src\video\windows\SDL_windowswindow.c". Whenever you call "SetProp" to add a property to a Win32-window, you should also call the Win32-function "RemoveProp" to remove it before destroying that Win32-window. While you might think that it's ok and that Windows will clean up nicely itself, it is not ok. It is against all Win32-API guidelines and is mostlikely a leak. Especially on external windows (CreateWindowFrom) you want to have things done right, not messy and leaky, affecting some other module. Even if SDL gets shutdown entirely that external window will now forever still have the "SDL_WindowData" prop attached to it.
Ryan C. Gordon 6d1ad384 2015-05-28T01:54:52 Windows GetBasePath should use GetModuleFileNameExW() and check for overflows. Apparently you might get strange paths from GetModuleFileName(), such as short path names or UNC filenames, so this avoids that problem. Since you have to tapdance with linking different libraries and defining macros depending on what Windows you plan to target, we dynamically load the API we need, which works on all versions of Windows (on Win7, it'll load a compatibility wrapper for the newer API location). What a mess. This also now does the right thing if there isn't enough space to store the path, looping with a larger allocated buffer each try. Fixes Bugzilla #2435.
Ryan C. Gordon 84ce0006 2015-05-28T01:27:24 I think this will be the time...
Ryan C. Gordon 7964f3ad 2015-05-28T01:22:14 Still trying to get this to compile...
Ryan C. Gordon cae4fd7f 2015-05-28T01:16:55 More patching to compile...
Ryan C. Gordon e90f87ba 2015-05-28T01:08:33 Another attempt to get this to compile.
Ryan C. Gordon 4add1694 2015-05-28T01:02:03 Patched to compile on MingW. (I think!)
Ryan C. Gordon 58447b24 2015-05-28T00:54:52 Move tests from SDL_config higher up in Windows joystick/haptic code. Fixes Bugzilla #2932.
Ryan C. Gordon 2a757825 2015-05-28T00:30:21 X11: Add Xdbe support to message boxes (thanks, Melker!). Without this, message boxes with a lot of text will noticibly flicker as you mouse over buttons. Fixes Bugzilla #2343.
Ryan C. Gordon bea1854c 2015-05-27T19:00:56 Patched to compile on C89 compilers.
Ryan C. Gordon 9c343681 2015-05-27T18:54:06 Wayland: Avoid NULL dereference after window destruction (thanks, "x414e54"!). Fixes Bugzilla #2934.
Sam Lantinga 7f17e0ab 2015-05-27T10:29:43 Fixed detecting PS4 wired controller on Windows
Ryan C. Gordon 80cfccbf 2015-05-26T22:57:42 Back out changeset b80349dd6d40. This change didn't do what I thought it did, sorry.
Ryan C. Gordon 059a0307 2015-05-26T21:30:41 Uh, yeah, it helps to press "Save" before committing...
Ryan C. Gordon c69a5592 2015-05-26T21:29:45 X11: generate clipboard update events (thanks, "chw"!). Partially fixes Bugzilla #2266.
Ryan C. Gordon cc493d71 2015-05-26T21:26:27 X11: use XA_STRING for text SDL puts on the clipboard (thanks, "chw"!). Partially fixes Bugzilla #2266.
Ryan C. Gordon baea64e6 2015-05-26T21:19:23 Stack hint should look for 0, not -1, and not care about environment variables.
Ryan C. Gordon a8fa7bd1 2015-05-26T21:13:27 Added a hint to specify new thread stack size (thanks, Gabriel!). Fixes Bugzilla #2019. (we'll do a better fix when we break the API in SDL 2.1.)