src/video


Log

Author Commit Date CI Message
Sam Lantinga f142a796 2017-08-14T13:37:14 Fixed bug 2441 - SDL_DuplicateSurface Rainer Deyke I've written a small patch that adds a small SDL_DuplicateSurface function to SDL. I've written the function as part of a larger (as yet unfinished) patch, but I think this function is useful enough that it merits inclusion in SDL on its own.
Sam Lantinga 362d5496 2017-08-14T10:28:47 Fixed bug 2500 - X11: SDL tries (and fails) to hide foreign windows Alvin I'm interested in this bug as well. I have experienced it when trying to embed an SDL_Window into a FLTK application. To do this, I create a FLTK window (window inside a window - think video player) and then use SDL_CreateWindowFrom() on the inner most window's Xlib Window*. After which, I create a renderer. In my situation I am using the FLTK GUI toolkit. What I have experienced is that the SDL_CreateRender() will recreate the window in order to properly setup OpenGL capability. As part of this process, the window is hidden and a call is executed that waits indefinitely for an acknowledgement that the window was indeed unmapped. This is where my program hangs. Please correct me if I am wrong, but should SDL2 not make Xlib calls that effect the Xlib Window in this situation (e.g. When SDL_CreateWindowFrom() is used)? The toolkit being used typically assumes responsibility and, I presume, tracks all Xlib Windows it creates. On line src/video/SDL_video.c:1372 the comment associated with setting SDL_WINDOW_FOREIGN reads: /* Can't destroy and re-create foreign windows, hrm */ Since I do not know the reason for hiding the window in the first place, the attached patch simply does not wait for a response when X11_XWithdrawWindow() and X11_XMapRaised() are issued by X11_HideWindow() and X11_ShowWindow(), respectively. I presume that the GUI toolkit (GTK, FLTK, etc.) has or will consume the acknowledging event as it is managing the Xlib Window (or it thinks it is). I have tested the patch against hg 5c645d037de2 and I have successfully tested: * Embedding the SDL_Window inside a FLTK application. * Calling SDL_SetWindowSize() when FLTK resizes the window (e.g. dragging cursor on the edge of the window). * Filling the renderer's default target blue and drawing a red fill square at the centre (exciting, I know!) * Calling SDL_Quit() when the application terminates I do not receive any Xlib erorr messages (BadWindow, etc.) in any of those situations.
Sam Lantinga de91b124 2017-08-14T06:28:21 Fixed bug 3745 - specify SDLCALL as the calling convention for API callbacks Patches contributed by Ozkan Sezer
Sam Lantinga eb06aba8 2017-08-13T21:16:58 Fixed bug 3742 - minor warning fixes
Sam Lantinga 3cae0c38 2017-08-13T21:09:00 Fixed bug 3746 - remove SDLCALL attribute from SDL_BlitFunc() funcptr Ozkan Sezer The attached patch removes SDLCALL attribute from SDL_BlitFunc() funcptr. As far as I can see, *SDL_BlitFunc() is completely internal to SDL with no specific calling convention requirements. The actual functions assigned to SDL_BlitFunc seem to not have any calling conventions specified. So, easy solution is simply removing the strict calling convention from the type.
Sam Lantinga e54eede2 2017-08-13T21:05:15 Provide the correct state of the on-screen keyboard to the API (patch from Sylvain)
Sam Lantinga 6ee66139 2017-08-13T20:55:59 Fixed bug 3235 - Make the Android window creation similar to iOS' window creation Sylvain Here's a patch. It tries to get the hint first. Resizable will allow any orientation. Otherwise it uses width/height window. setOrientation method is splitted in static and non-static, so that it can be overloaded in a user subclass. Some artefact observed : surfaceChanged() can be called twice at the beginning. When the phone starts in portrait and run a landscape application.
Sam Lantinga 6ef1a25d 2017-08-13T20:51:08 Fixed bug 3751 - DirectFB linux_input disabled by default Clayton Craft linux_input module is disabled by default, despite the comments in source code that it is otherwise: src/video/directfb/SDL_DirectFB_video.c: devdata->use_linux_input = readBoolEnv(DFBENV_USE_LINUX_INPUT, 0); /* default: on */ src/video/directfb/SDL_DirectFB_video.h: #define DFBENV_USE_LINUX_INPUT "SDL_DIRECTFB_LINUX_INPUT" /* Default: on */ When using the directfb driver, the linux_input module is suppressed unless the SDL app is started with "SDL_DIRECTFB_LINUX_INPUT=1" set in the environment. I recall seeing at one point that the directfb folks recommended using linux_input over the other input drivers, but I am having trouble locating this recommendation. In any case, I believe that this should really be defaulted to 'on' since it's vastly superior to the other dfb input drivers!
Sam Lantinga 78865eff 2017-08-13T20:38:06 Fixed compiler warning
Sam Lantinga c87e1d52 2017-08-13T14:15:52 Fixed bug 2841 - Hint to set resource id for window icon Alexey Seems to be a missing functionality. I want to set an icon from RC file. I cant pass MAKEINTRESOURCE(X) string to SDL_RegisterApp() cause string returned by MAKEINTRESOURCE string is not actually a string and SDL_strlen will crash. Moreover LoadImage seems to be loading wrong icon size. LoadIcon seems to be fine.
Ryan C. Gordon 18cceb5c 2017-08-13T01:00:01 x11: Patched to compile.
Ryan C. Gordon 0a1b905b 2017-08-13T00:58:23 x11: Fix message box titles with Unicode chars on some window managers. Fixes Bugzilla #2971.
Alex Szpakowski 9be597a0 2017-08-12T22:16:04 iOS: Fix app orientation when creating a landscape fullscreen window with the device currently in portrait orientation.
Sam Lantinga 059d9e46 2017-08-12T17:41:59 Fixed bug 2950 - wrong axes values are set on joystick initialization Edward Rudd Device: Logitech Rumble Gamepad F510 in Xinput mode. Upon opening the joystick the values of the axes are queried via PollAllValues are not actually set on the device all the time. This can easily be seen in the testjoystick or testgamecontroller test programs,as the testjoystick shows all axes in the center until one 'tickles' the triggers., and the testgamecontroller will show the triggers as 'on' until on 'tickles' the triggers. Upon further research the culprit is the SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS hint. In the default value events are ignored until there is an active window, Thus in cases where the joystick system is initialized and controllers opened before the initial window is created & focuses, the initial values will be incorrect. Here is my current workaround in the game I'm working on porting.. SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "1"); SDL_GameController* gamepad = SDL_GameControllerOpen(index); SDL_SetHint(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS, "0");
Sam Lantinga 7bab2913 2017-08-12T17:01:14 Fixed Windows build
Sam Lantinga 05facb3d 2017-08-12T16:59:00 Fixed bug 2979 - SDL_ConvertSurface does not convert color keys consistently Edmund Horner When a 16-bit "565 format" surface has a colour key set, it will blit with correct transparency. If, however, it has its colour key set then is converted to a 32-bit ARGB format surface, the colour key in the converted image will not necessarily be the same pixel value as the transparent pixels. It may not blit correctly, because the colour key does not match the right pixels. In my case, with an image using 0xB54A for transparency, the colour key was converted to 180,170,82; but the corresponding pixels (with the same original value) were converted to 180,169,82. Blitting the converted image did not use transparency where expected. I have attached a test case. The bug has been replicated on both x86_64 Linux (SDL 2.0.2), and 32-bit MS C++ 2010 on Windows (SDL 2.0.0).
Sam Lantinga d226594f 2017-08-12T16:48:46 Workaround for bug 3049 - SDL_Init(SDL_INIT_VIDEO) - XDM authorization key matches an existing client! malferit Hello, I began a little program with SDL2 on Linux in C, and when I call SDL_Init(SDL_INIT_VIDEO) I get an error and this is printed in the console: XDM authorization key matches an existing client! I searched through Internet, and found that some people suggest to run 'xhost +' or to specify this in /etc/X11/xdm/xdm-config: DisplayManager*authName: MIT-MAGIC-COOKIE-1 I don't think an end user needs to know that... But what bothered me is that first I started this little program in Pascal using the Freepascal compiler and it works. In freepascal you only use some thin header bindings in Pascal and then it links with the dynamic SDL library, so I don't understood why it worked with Freepascal and not in C. I run ldd to the two generated applications: Application in C: linux-gate.so.1 (0xffffe000) libSDL2-2.0.so.0 => /usr/lib/libSDL2-2.0.so.0 (0xb76ac000) libpthread.so.0 => /lib/libpthread.so.0 (0xb766e000) libc.so.6 => /lib/libc.so.6 (0xb74e2000) libm.so.6 => /lib/libm.so.6 (0xb74a0000) libdl.so.2 => /lib/libdl.so.2 (0xb749a000) librt.so.1 => /lib/librt.so.1 (0xb7491000) /lib/ld-linux.so.2 (0xb77b3000) Application compiled with Freepascal: linux-gate.so.1 (0xffffe000) libSDL2-2.0.so.0 => /usr/lib/libSDL2-2.0.so.0 (0xb762a000) libX11.so.6 => /usr/lib/libX11.so.6 (0xb74f3000) libc.so.6 => /lib/libc.so.6 (0xb7367000) libm.so.6 => /lib/libm.so.6 (0xb7325000) libdl.so.2 => /lib/libdl.so.2 (0xb731f000) libpthread.so.0 => /lib/libpthread.so.0 (0xb7305000) librt.so.1 => /lib/librt.so.1 (0xb72fc000) libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb72dc000) libXau.so.6 => /usr/lib/libXau.so.6 (0xb72d9000) libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb72d3000) /lib/ld-linux.so.2 (0xb7755000) It seems that Freepascal is linking with libX11, libxcb, libXau and libXdmcp . Linking my C application with libxcb solved the problem (linking with libXau and/or libXdmcp without libxcb didn't work). Linking with X11 links all the other libraries and works as well. So I fill this bug report mainly to let you know about this. I don't know if it is a problem that can be solved on the libSDL side or not, but at least I hope it will help. Hi, some tests: 1. Disabled XDM. Login in console and running 'startx'. The program works without having to link with X11. 2. Enabled XDM. Added 'DisplayManager*authName: MIT-MAGIC-COOKIE-1' to /etc/X11/xdm/xdm-config.The program works without having to link with X11. 3. Enabled XDM without 'DisplayManager*authName: MIT-MAGIC-COOKIE-1' in /etc/X11/xdm/xdm-config . I get the authentication error unless I link with X11.
Sam Lantinga 45cec28b 2017-08-12T16:44:00 Fixed bug 3058 - Slight mistake in GetWindowStyle in SDL_windowswindow.c Coriiander There's a slight mistake in the function "GetWindowStyle" found in file "SDL_windowswindow.c". When a window is marked to be resizable, the resizable style is being added regardless of whether the window has a border or not. While for some arcane, hidden semantics this can be ok, it's still inconsistent in this case.
Sam Lantinga e3f3a757 2017-08-12T16:02:33 Fixed bug 3158 - SDL display window scrambled over VNC Witek Jachimczyk I'm using SDL to develop a video viewer for MATLAB. The window is scrambled while using thightVNC with its default mode of RGB656. SDL does not correctly recognize the pixel mode. I found a solution for this problem. The solution involves modifying SDL/src/video/SDL_pixels.c Adding the following "if statement" under case 16: of SDL_MasksToPixelFormatEnum resolves the issue: if (Rmask == 0x003F && Gmask == 0x07C0 && Bmask == 0xF800 && Amask == 0x0000) { return SDL_PIXELFORMAT_RGB565; } I hope that this helps someone. I took me a while to figure it out.
Sam Lantinga 4a9c6f0a 2017-08-12T15:55:54 Fixed bug 3173 - SDL_GL_GetAttribute overwrites error code from SDL_GL_GetProcAddress Yann Dirson When SDL_GL_GetProcAddress returns in error, the cause of the error is overwritten in GL_GL_GetAttribute, reporting to the user "Failed getting OpenGL glGetString entry point", whereas the original "OpenGL library not loaded" never makes it to the user. Pushed a fix to: https://github.com/O-Computers/SDL/commit/f94cb13708ef4d236f8a2a330135b9b3a47db204 Note that the "OpenGL library not loaded" error looks like no root cause either, and I'm still puzzled by the code path used: I'm forcing opengles2 renderer on the x11 video driver on a rpi2, as in https://bugzilla.libsdl.org/3169, and although I now know that I must force the use of the RPI video driver instead of the x11 one, I suspect even more accurate info can be given to user.
Sam Lantinga 1a544145 2017-08-12T15:21:26 Fixed bug 3309 - SDL_ConvertSurface adds AlphaMod when input surface has ColorKey Sylvain Let's you have a SDL_Surface that has ColorKey, but no Alpha Modulation. When this surface is duplicated with SDL_ConvertSurface function, the result has ColorKey and Alpha Modulation (BLEND, and Opaque 255). I think SDL_ConvertSurface should strictly keeps the input format. example ======= SDL_Surface *input; // ... Set up a surface with ColorKey and no AlphaMod SDL_Surface *output = SDL_ConvertSurface(input, input->format, input->flags); // "output" surface has a ColorKey but *also* AlphaMod (BLEND, and Opaque 255).
Sam Lantinga 47c2c7d5 2017-08-12T12:56:28 Cleaned up WindowsScanCodeToSDLScanCode() so VKeytoScancode() always takes precedence for the keys it handles and the rest of the logic is easier to read.
Sam Lantinga c0862512 2017-08-12T12:24:59 Fixed bug 3128 - Removing all the static variables from android SDLActivity and accompanying JNI calls. owen I removed all the static variables from SDLActivity.java Updated all the SDL_android.c jni calls as well I added a new function to SDL_android.c/ h void Android_JNI_SeparateEventsHint(const char* c); This is called by SDL_androidtouch.c so that this TU doesn't need to call any JNI functions.
Sam Lantinga 78c84e70 2017-08-12T08:06:16 Fixed part of bug 3227 - patch for multiple buttons at the same time not working Philipp Wiesemann There is another problem with the current implementation which maybe should be fixed first (to prevent some work). It was written as if it would get the number of a button from the Java side but actually it gets the state of all buttons. That is why it should not work if more than one button is pressed at once.
Sam Lantinga b425050b 2017-08-12T00:04:46 Fixed compiler warnings on Visual Studio 2013
Sam Lantinga 79a846d4 2017-08-11T19:42:39 Fixed bug 3334 - SDL_ShowMessageBox uses wrong index and accesses un-allocated memory romain.lacroix For the windows implementation of SDL_ShowMessageBox() : ./src/video/windows/SDL_windowsmessagebox.c:345 WIN_ShowMessageBox() The implementation in 2.0.4 uses "button index" for parameter "id" of function AddDialogButton(). It then expects the value provided in param wParam of function MessageBoxDialogProc() to be a valid index of a button. It uses this value to index in the array of buttons when DialogBoxIndirect() returns (line 474 : *buttonid = buttons[which].buttonid;) However, when dismissing this box with Escape, the return value of DialogBoxIndirect will be SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT (=2) which is not always a valid index of array buttons. When the array buttons has a length less or equal than 2, the memory access is invalid; I can see that the value written to *buttonId is uninitialized memory (random value). The fix I propose : use value "buttonid" (field of button) for parameter "id" of AddDialogButton(), then copy return value of DialogBoxIndirect() in *buttonid. This way, we will not use an out-of-bounds index in array buttons.
Sam Lantinga 1da252c2 2017-08-11T18:56:41 Fixed crash in bug 3367 - RGBA_FROM_PIXEL macro can't handle SDL_PIXELFORMAT_ARGB2101010 Simon Hug The RGBA_FROM_PIXEL macro in src/video/blit.h [1] is not designed to work with more than 8 bits per channel and the ARGB2101010 format makes it read outside of the array bounds causing access violations. This can happen during blitting with the BlitNtoNPixelAlpha and SDL_Blit_Slow functions. When SDL_InitFormat tries to calculate the loss of the channels [2], the Uint8 will wrap around and it will end up at 254 for the 10-bit channels. Clearly way over the 9 entries of the SDL_expand_byte array. (Not that a signed integer would help.) Then the macro tries to access the lookup table with the channel value which could be up to 1023. If the previous indirection didn't cause an access violation this one will. I guess it's not worth modifying this macro for a format that only a few will use. It will only make the other blitters slower. I don't have good ideas to solve this issue. Attached is a test case that does three blits. A copy one that work and the two that use the functions mentioned above. [1] https://hg.libsdl.org/SDL/file/cd1994d4f3c6/src/video/SDL_blit.h#l303 [2] https://hg.libsdl.org/SDL/file/cd1994d4f3c6/src/video/SDL_pixels.c#l540
Sam Lantinga 96305832 2017-08-11T10:21:19 Fixed bug 3702 - Clear error messages of SDL_LoadObject for optional libraries Simon Hug Some code in SDL loads libraries with SDL_LoadObject to get more information or use newer APIs. SDL_LoadObject may fail, set an error message and SDL will continue with some fallback code. Since SDL will overwrite the error or exit the function with a return value that indicates success, the error form SDL_LoadObject for the optional stuff might as well be cleared right away.
Sam Lantinga 6e1b11ba 2017-08-11T10:18:45 Fixed bug 3714 - Windows: SDL_WINDOW_FULLSCREEN_DESKTOP broken on 3 monitor setup w/ DPI scaling Eric Wasylishen 2017-07-26 18:42:58 UTC I set up an (admittedly exotic) 3-monitor setup, and when I enter fullscreen-desktop on the middle display (#2), the SDL window is off center. (covers half of monitor #2 and most of monitor #3). The displays are arranged from left to right: Display #1 (main): 2880x1800, 200% scaling Display #2: 1920x1200, 150% scaling Display #3: 1920x1080, 100% scaling SDL display bounds: INFO: Bounds: 1440x900 at 0,0 INFO: Bounds: 1281x801 at 1921,0 (these are incorrect) INFO: Bounds: 1920x1080 at 4800,0 Correct bounds reported by calling EnumDisplayMonitors and printing the LPRECT param of the callback: 1440x900 at (0, 0) 1280x800 at (2880, 0) 1920x1080 at (4800, 0) It seems like you need 3 displays to reproduce this, and the left two need DPI scaling, and the 3rd display needs to have a different scale factor than the others. Related: https://bugzilla.libsdl.org/show_bug.cgi?id=3709 SDL: current hg (11235:6a587b9e0ec8) Windows 10, Version 10.0.15063 Build 15063 Tested with testdraw2 and testgl2, and pressing alt+enter to enter fullscreen desktop. This patch reworks SDL_windowsmodes.c to use EnumDisplayMonitors instead of EnumDisplayDevices, so we always have an HMONITOR for each SDL display. With access to an HMONITOR, we can get the monitor bounds in virtual screen coordinates the proper way, by calling GetMonitorInfo. (whereas the original code was doing some calculations - e.g. "data->DeviceMode.dmPosition.x * data->ScaleX" - to try to get virtual screen coordinates. These worked in simple cases, but failed in more complex cases like this bug) The one potential problem with my patch is, the ChangeDisplaySettingsEx docs say that you're supposed to get the display name from EnumDisplayDevices, but I'm getting the display name from GetMonitorInfo now.
Sam Lantinga a05522a0 2017-08-11T10:05:45 Fixed bug 3723 - Possible double free in kmsdrm init code on certain errors Simon Hug KMSDRM_VideoInit allocates and frees some connectors and encoders but doesn't set the pointer to NULL after freeing. The cleanup code at the end may free one of those garbage pointer should an error happen in the initialization.
Sam Lantinga 843293be 2017-08-09T20:26:16 Fixed bug 3701 - WM_TOUCH message may cause calls to null if touch functions are not properly loaded Simon Hug When WIN_WindowProc processes the WM_TOUCH message, it doesn't check if the touch functions have been properly loaded and may call a NULL pointer. It's probably an extremely rare case, but here's a patch that adds some checks anyway.
Ryan C. Gordon 69092c7e 2017-08-09T18:30:48 haiku: Fixed compiler warning.
Ryan C. Gordon a412ba0d 2017-08-09T01:01:41 haiku: Patched SDL_bopengl.cc to compile on x86-64 Haiku. Fixes Bugzilla #3729.
Ryan C. Gordon d5215d9d 2017-08-09T00:56:05 Fixed up some compile warnings and errors on x86-64 Haiku.
Philipp Wiesemann 27de835d 2017-08-05T22:10:55 emscripten: Fixed compiler warnings about integer to pointer conversions. Found by buildbot.
Philipp Wiesemann 711df8a9 2017-08-05T22:10:48 emscripten: Fixed compiling without OpenGL support.
Philipp Wiesemann f216b446 2017-08-05T22:10:36 kmsdrm: Fixed crashes if allocating memory failed.
Philipp Wiesemann b8a7dd77 2017-08-05T22:10:25 nacl: Fixed freeing static memory on video quit.
Philipp Wiesemann 1f698469 2017-08-05T22:10:15 mir: Removed unnecessary function declaration.
Philipp Wiesemann 4723943b 2017-08-04T23:00:47 kmsdrm: Fixed compiling without OpenGL support.
Sam Lantinga cc5ceb11 2017-08-04T13:06:56 Temporary hack to fix bug 3725 - Call made to glGetString before context creation This breaks bugs 2570, 3145
Brandon Schaefer 86e95a60 2017-08-02T17:45:15 kmsdrm: Fix tearing in neverputt/ball https://gfycat.com/FatalFarawayHeron
Brandon Schaefer fca91451 2017-08-02T13:51:14 kmsdrm: Fix leaking SDL_VideoDevice*
Sam Lantinga 082f32d1 2017-08-02T10:28:13 Fixed bug 3722 - Fall back to xinerama/xvidmode if xrandr modes initialization fails Levi Bard In some environments, xrandr modes initialization can fail even though xrandr support is present and of a sufficient version. (The one I encountered was an AWS instance running a virtual display) The attached patch allows SDL to keep trying other methods if xrandr modes initialization fails (still subject to SDL_VIDEO_X11_REQUIRE_XRANDR).
Sam Lantinga 4be06670 2017-08-02T10:24:47 Fixed potential free of uninitialized memory (thanks Simon!)
Sam Lantinga 56363ebf 2017-08-02T10:22:48 Fixed bug 3690 - SDL2 KMS/DRM render context support Manuel The attached patch adds support for KMS/DRM context graphics. It builds with no problem on X86_64 GNU/Linux systems, provided the needed libraries are present, and on ARM GNU/Linux systems that have KMS/DRM support and a GLES2 implementation. Tested on Raspberry Pi: KMS/DRM is what the Raspberry Pi will use as default in the near future, once the propietary DispmanX API by Broadcom is overtaken by open graphics stack, it's possible to boot current Raspbian system in KMS mode by adding "dtoverlay=vc4-kms-v3d" to config.txt on Raspbian's boot partition. X86 systems use KMS right away in every current GNU/Linux system. Simple build instructions: $./autogen.sh $./configure --enable-video-kmsdrm $make
Sam Lantinga 997c69b9 2017-08-01T20:16:10 Fixed bug 3697 - Main thread gets stuck on left mouse down Eric Wasylishen I think I found a better fix. The problem with https://hg.libsdl.org/SDL/rev/ebdc0738b1b5 is setting the styleMask to 0 clears the NSWindowStyleMaskFullScreen bit, which then confuses Cocoa later when you try to leave fullscreen. Instead I'm just clearing the NSWindowStyleMaskResizable bit, although SetWindowStyle(window, NSWindowStyleMaskFullScreen); seems to also work.
Sam Lantinga 6391cc3f 2017-08-01T20:09:23 Backed out changeset ebdc0738b1b5 for bug 3697 Eric Wasylishen Unfortunately this commit seems to have broken exiting desktop-fullscreen. - Launch testgl2. - Press alt+enter to go fullscreen-desktop - Press alt+enter again. The spinning cube will freeze, and the window stays fullscreen desktop.
Sam Lantinga e10a98d2 2017-07-31T12:57:15 Fixed bug 3720 - SDL_GL_GetAttribute doesn't check for initialized video driver Simon Hug SDL_GL_GetAttribute doesn't check if a video driver has been initialized and will access the SDL_VideoDevice pointer, which is NULL at that point. I think all of the attributes require an initialized driver, so a simple NULL check should fix it. Patch is attached.
Ryan C. Gordon 2ffd6d02 2017-07-31T13:49:22 x11: Make a separate unmapped window to own clipboard selections. Now the clipboard isn't lost if you destroy a specific SDL_Window, as it works on other platforms. You will still lose the clipboard data on SDL_Quit() or process termination, but that's X11 for you; run a Clipboard Manager daemon. Fixes Bugzilla #3222. Fixes Bugzilla #3718.
Brandon Schaefer b0b481d7 2017-07-27T08:03:11 [mir] Same no need to wrap this, which is already being done
Brandon Schaefer ecf9f6a1 2017-07-26T18:10:45 [mir] Point to SDL_EGL_UnloadLibrary vs doing it our selfs
Ryan C. Gordon 03eaddca 2017-07-23T19:25:16 Fixed compiler warnings on QNX.
Sam Lantinga 67754af8 2017-07-21T17:28:47 Fixed build on older Mac OS X SDKs
Sam Lantinga 177f19af 2017-07-20T10:52:43 Fixed bug 3410 - SDL_WINDOW_HIDDEN flag is inaccurate. Jason Wyatt After hiding the window, SDL_WINDOW_HIDDEN/SDL_WINDOW_SHOWN flags on a window are correctly updated. However on the next SDL_PumpEvents, they are set incorrectly. This appears to be because X11_GetNetWMState does not check whether the _NET_WM_STATE property exists (it shouldn't on unmapped windows, see https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html#idm140130317598336). This results in an empty list of atoms for the state, which would imply that the window is not hidden. (Seen on Fedora 24, Gnome) -- Dan Ginsburg More details on my proposed patch: I am on Kubuntu 16.04.2. I ran into this same bug, but with Jason's patch I found that actualType != None was true so the SDL_WINDOW_HIDDEN would still not be set. My fix instead is to explicitly check for whether the window is unmapped rather than relying on the returned values in XGetWindowProperty.
Sam Lantinga 2008d866 2017-07-20T10:46:38 Fixed bug 3703 - Missing media keys support on Amazon Fire TV remote control Holger Schemel Summary: This patch adds support for key events for the "rewind" and "fast forward" media keys on the Amazon Fire TV remote control. How to reproduce the problem: Run Android build of SDL2 application on the Amazon Fire TV (tested with "stick" version) and log key events. Expected behaviour: Every key pressed on the Fire TV remote control should result in a corresponding key event (pressed/released). Observed behaviour: Of the bottom row of buttons on the Fire TV remote control, only the "play/pause" (middle) button generates a key event, while the "rewind" (left) and "fast forward" (right) buttons to not generate any event at all. The attached patch adds support for these two missing buttons/keys. Note 1: Some missing definitions were added for the already existing key codes SDL_SCANCODE_APP1 and SDL_SCANCODE_APP2 (to keep up the correct order of enumerations / array positions when adding the two new key codes). Note 2: Definitions in "scancodes_linux.h" and "scancodes_xfree86.h" (to also add support for these keys on other platforms) were added without testing. However, I was unable to find corresponding definitions for these two media keys for Windows and Mac OS X. Note 3: I have also updated the (broken) link to the USB usage page standard PDF document (comment in "include/SDL_scancode.h").
Alex Szpakowski 01050d4e 2017-07-15T17:41:58 iOS: Use modern replacements for deprecated functions, when available.
Alex Szpakowski efe179cd 2017-07-14T17:42:11 macOS: Fix compilation when using 10.11 or earlier to build.
Alex Szpakowski 562473c1 2017-07-13T23:09:37 macOS: Address more compiler warnings when building with a recent deployment target.
Alex Szpakowski bc3ede1e 2017-07-13T22:59:02 macOS: Replace uses of deprecated Cocoa enum names with modern/consistent equivalents.
Alex Szpakowski e0ea4da4 2017-07-12T21:32:10 Fix a potential crash in macOS 10.7 and earlier.
Alex Szpakowski 8292d73e 2017-07-12T21:28:32 macOS: Expose more display modes on retina screens. Fixes an issue found in BZFlag.
Sam Lantinga 74ca1654 2017-07-11T08:16:00 Fixed bug 3699 - Shaped windows are distorted unless width is divisible by 8 Bogomancer On X11, windows created using the shaped window API appear distorted unless the width of the shape surface is divisible by 8. Steps to reproduce: 1) Use your favorite image editor to resize one of the images in test/shapes/ to a width that's not a multiple of 8. 2) Compile and run test/testshape.c on the image you edited. 3) The shaped window will appear twisted and distorted. It appears the bug was not caught sooner because all the test images are either 640 or 256 pixels wide. I tracked down the bug to SDL_CalculateShapeBitmap() in SDL_shape.c. The shape surface is reduced to a 1-bit-per-pixel mask, but the original code doesn't take into account that X11 apparently wants each scanline to begin on a new byte.
Sam Lantinga 37722d01 2017-07-10T17:07:19 Fixed bug 3697 - Main thread gets stuck on left mouse down Amruth Raj - My app runs in full screen to play video(I use SDL_WINDOW_FULLSCREEN_DESKTOP) - Cmd-tab to go out of full screen to another app - Cmd-tab again to get back to my app - Press left mouse button at one of the edges of the screen, don't release yet. After this point the main thread is stuck until I release the left mouse button and hence video rendering doesn't happen anymore. On debugging more, I see that thread 0 is stuck as shown below with sendEvent processing left mouse down. It comes out only after it receives a left mouse up. There are some frames below which show NSWindowResizing, but my window flag doesn't have SDL_WINDOW_RESIZABLE set. Thread 0:: CrBrowserMain Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x00007fffbe13d34a mach_msg_trap + 10 1 libsystem_kernel.dylib 0x00007fffbe13c797 mach_msg + 55 2 com.apple.CoreFoundation 0x00007fffa889d434 __CFRunLoopServiceMachPort + 212 3 com.apple.CoreFoundation 0x00007fffa889c8c1 __CFRunLoopRun + 1361 4 com.apple.CoreFoundation 0x00007fffa889c114 CFRunLoopRunSpecific + 420 5 com.apple.HIToolbox 0x00007fffa7dfdebc RunCurrentEventLoopInMode + 240 6 com.apple.HIToolbox 0x00007fffa7dfdcf1 ReceiveNextEventCommon + 432 7 com.apple.HIToolbox 0x00007fffa7dfdb26 _BlockUntilNextEventMatchingListInModeWithFilter + 71 8 com.apple.AppKit 0x00007fffa6396a54 _DPSNextEvent + 1120 9 com.apple.AppKit 0x00007fffa6b127ee -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 2796 10 com.apple.AppKit 0x00007fffa66f568d +[NSWindow(NSWindowResizing) _mouseHysteresisCheck:withExpiration:andDistance:finalMouseLocation:] + 525 11 com.apple.AppKit 0x00007fffa65eedb5 -[NSWindow(NSWindowResizing) _hitTestWithHysteresisCheck:forEvent:allowWindowDragging:] + 394 12 com.apple.AppKit 0x00007fffa6c8f0db -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 1873 13 com.apple.AppKit 0x00007fffa6c8ca6c -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 1942 14 com.apple.AppKit 0x00007fffa6c8bf0a -[NSWindow(NSEventRouting) sendEvent:] + 541 15 org.libsdl.SDL2 0x000000010d46d74a -[SDLWindow sendEvent:] + 90 16 com.apple.AppKit 0x00007fffa6b10681 -[NSApplication(NSEvent) sendEvent:] + 1145 17 org.libsdl.SDL2 0x000000010d46532b -[SDLApplication sendEvent:] + 139 18 org.libsdl.SDL2 0x000000010d466b2f Cocoa_PumpEvents + 495 19 org.libsdl.SDL2 0x000000010d44c1d5 SDL_PumpEvents_REAL + 53 20 org.libsdl.SDL2 0x000000010d44c2f5 SDL_WaitEventTimeout_REAL + 53 21 org.libsdl.SDL2 0x000000010d44c2b7 SDL_PollEvent_REAL + 23 22 org.libsdl.SDL2 0x000000010d51bb24 SDL_PollEvent + 36 23 libTest.dylib 0x000000010cf3e0e8 SDLEventProcessor::processEvents(int) + 568 24 Test 0x000000010cde6bba BrowserApp::RunAppMessageLoop(BAInstData*, CefStringBase, CefStringBase) + 810 25 Test 0x000000010ce04bbc main + 17980 26 libdyld.dylib 0x00007fffbe016235 start + 1 I further noticed that while entering full screen in SDL_cocoawindow.m NSResizableWindowMask is set. If I clear it inside windowDidEnterFullScreen, then, the issue doesn't repro. This is discussed at https://discourse.libsdl.org/t/main-thread-gets-stuck-on-left-mouse-down/22753/3 and thanks to Eric for the pointers.
Philipp Wiesemann c3bf69ca 2017-07-07T23:00:22 haiku: Fixed compiling without OpenGL support.
Ryan C. Gordon c80c3419 2017-07-04T20:44:07 x11: pass a long to XChangeProperty, not an int. The Xlib documentation demands that 32-bit values here be passed in a long, even when long itself isn't a 32-bit value. Otherwise libx11 might read memory incorrectly. Fixes Bugzilla #3692.
Philipp Wiesemann e6583300 2017-07-02T22:46:23 haiku: Fixed using wrong constant for internal error handling. SDL_CreateWindow() worked because ENOMEM is negative on Haiku.
Ryan C. Gordon 200f782c 2017-07-01T19:52:12 qnx: fixed potential buffer overflow.
Ryan C. Gordon 22241ed0 2017-07-01T17:50:47 Support for QNX 7.0 (thanks, Elad!). Fixes Bugzilla #3686.
Philipp Wiesemann b1fbab50 2017-07-01T23:01:57 haiku: Fixed memory leak if destroying window.
Philipp Wiesemann 944e06e6 2017-06-24T23:45:44 winrt: Fixed SDL include.
Philipp Wiesemann 267dca13 2017-06-18T23:00:42 haiku: Removed unused internal function. Its functionality is already in SDL_GL_GetAttribute().
Philipp Wiesemann 90488d6c 2017-06-17T22:30:28 haiku: Added support for some values set with SDL_GL_SetAttribute().
Philipp Wiesemann 0b750cd9 2017-06-16T23:30:38 pandora: Fixed compile error.
Philipp Wiesemann fa73685d 2017-06-16T23:30:30 directfb: Fixed quitting keyboard twice. SDL_VideoQuit() already calls SDL_KeyboardQuit().
Philipp Wiesemann a4db3dbe 2017-06-16T23:30:13 nacl: Fixed unnecessary large input text array.
Sam Lantinga 9085c7b3 2017-06-16T11:14:08 Get the parent of non-SDL-created windows, for completeness
Sam Lantinga 1b5614b3 2017-06-16T10:50:29 Clean up parent window when destroying a window
Sam Lantinga 0a75192d 2017-06-16T09:10:13 Implemented SDL_WINDOW_SKIP_TASKBAR on Windows
Philipp Wiesemann 60c0f7e2 2017-06-15T23:30:29 Fixed SDL_GetWindowWMInfo() returning success on three unsupported platforms.
Philipp Wiesemann 5b75e903 2017-06-11T22:30:49 directfb: Fixed comment.
Philipp Wiesemann fbd30c36 2017-06-11T22:30:39 Fixed missing error messages for SDL_GetWindowWMInfo().
Philipp Wiesemann c609d856 2017-06-11T22:30:24 directfb: Fixed crash if creating renderer. SDL_GetWindowWMInfo() currently expects SDL to be 2.0.6 but SDL is still 2.0.5.
Ryan C. Gordon 3c955d05 2017-06-11T00:50:26 syswm: prevent buffer overflow if SDL and app have different config headers. This only affects Wayland and DirectFB, as a Unix system generally has X11 support. Other platforms also have different sizes for the C union in question, but are likely the only target for that platform, etc. Apps that might run on Wayland or DirectFB will need to be compiled against new headers from an official 2.0.6 release, or be prepared to force the x11 target, or not use SDL_GetWindowWMInfo(). Fixes Bugzilla #3428.
Alex Szpakowski bb100d3b 2017-06-10T21:29:37 Expose display refresh rate on iOS/tvOS 10.3+.
Ryan C. Gordon 599d9ba1 2017-06-05T21:30:25 emscripten: listen for pointerlockchange events on the #document specifically.
Philipp Wiesemann 4b47fa38 2017-06-04T23:15:47 Removed duplicate includes.
Philipp Wiesemann 248410dd 2017-06-04T23:15:13 Fixed SDL_GL_SetSwapInterval() returning success on two unsupported platforms.
Philipp Wiesemann 2113208d 2017-06-03T23:00:50 haiku: Fixed missing title bar for windows with decorations. B_BORDERED_WINDOW_LOOK has a border but no title bar.
Philipp Wiesemann 63b3e06f 2017-06-03T23:00:15 Corrected names of header file guards.
ouned 34769abd 2017-06-03T09:13:08 prefer virtual keycodes over scancodes for extended keys
Philipp Wiesemann 00394996 2017-06-02T22:15:12 Fixed crash if calling SDL_CreateShapedWindow() on unsupported platforms.
Philipp Wiesemann 1b9dc599 2017-05-28T21:50:11 haiku: Fixed SDL_SetClipboardText() putting random data in clipboard.
Ryan C. Gordon de52dc29 2017-05-28T15:36:09 haiku: Correctly set keyboard focus (thanks, Kai!). The message sent upon the window being activated or deactivated, to trigger the call to SDL_SetKeyboardFocus was missing a mandatory parameter. So keyboard focus was never properly set. Fixes Bugzilla #3658.
Ryan C. Gordon b3f94acb 2017-05-28T07:11:52 linux: Simplify D-Bus interface, remove lots of boilerplate.
Philipp Wiesemann 604a4b1b 2017-05-27T23:30:21 haiku: Fixed SDL_SetClipboardText() allocating too much memory and cutting text. It allocated pointers instead of chars and passed a wrong size to SDL_strlcpy().
Ryan C. Gordon 6fbde875 2017-05-27T00:33:26 code style: wrap a single-statement if in braces.
Ryan C. Gordon 3fbd21ce 2017-05-27T00:30:06 windows: msgboxes should specify a parent HWND if possible (thanks, Ismael!). This lets them be properly modal. Fixes Bugzilla #3650.
Philipp Wiesemann 90ed3daa 2017-05-26T22:45:52 Changed messages about not recognized keys to include discourse link.
Philipp Wiesemann 75931972 2017-05-26T22:45:40 emscripten: Fixed compiling on C89 compilers.