Mon, 14 Aug 2017 10:28:47 -0700Fixed bug 2500 - X11: SDL tries (and fails) to hide foreign windows
Sam Lantinga <slouken@libsdl.org> [Mon, 14 Aug 2017 10:28:47 -0700] rev 11288
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 d09d4b578e77 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.

Mon, 14 Aug 2017 10:15:38 -0700Fixed bug 3752 - minor os2 defines
Sam Lantinga <slouken@libsdl.org> [Mon, 14 Aug 2017 10:15:38 -0700] rev 11287
Fixed bug 3752 - minor os2 defines

Ozkan Sezer

Attached three patches, so these minor os/2 bits get registered mainstream:

1. SDL_syswm.h: add SDL_SYSWM_OS2 to SDL_SYSWM_TYPE enum
2. SDL_platform.h: recognize __EMX__ too as __OS2__
3. begin_code.h: set SDLCALL as _System for OS/2.

Mon, 14 Aug 2017 10:14:07 -0700Fixed compiler warning with enum
Sam Lantinga <slouken@libsdl.org> [Mon, 14 Aug 2017 10:14:07 -0700] rev 11286
Fixed compiler warning with enum

Mon, 14 Aug 2017 10:04:59 -0700Fixed setting the texture blend mode in the OpenGL ES2 renderer
Sam Lantinga <slouken@libsdl.org> [Mon, 14 Aug 2017 10:04:59 -0700] rev 11285
Fixed setting the texture blend mode in the OpenGL ES2 renderer

Mon, 14 Aug 2017 06:28:21 -0700Fixed bug 3745 - specify SDLCALL as the calling convention for API callbacks
Sam Lantinga <slouken@libsdl.org> [Mon, 14 Aug 2017 06:28:21 -0700] rev 11284
Fixed bug 3745 - specify SDLCALL as the calling convention for API callbacks

Patches contributed by Ozkan Sezer

Mon, 14 Aug 2017 06:18:08 -0700Fixed bug 3191 - haptic system on android?
Sam Lantinga <slouken@libsdl.org> [Mon, 14 Aug 2017 06:18:08 -0700] rev 11283
Fixed bug 3191 - haptic system on android?

Sylvain

- add vibrator service in the list of haptic devices. I use an hard-coded device_id for it ...

Mon, 14 Aug 2017 05:51:44 -0700Implemented more flexible blending modes for accelerated renderers
Sam Lantinga <slouken@libsdl.org> [Mon, 14 Aug 2017 05:51:44 -0700] rev 11282
Implemented more flexible blending modes for accelerated renderers

This fixes bug 2594 - Propose new blend mode, SDL_BLENDMODE_BLEND_DSTA

blendMode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_SRC_ALPHA,
SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
SDL_BLENDOPERATION_ADD,
SDL_BLENDFACTOR_ZERO,
SDL_BLENDFACTOR_ONE,
SDL_BLENDOPERATION_ADD);

This fixes bug 2828 - Subtractive Blending

blendMode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_SRC_ALPHA,
SDL_BLENDFACTOR_ONE,
SDL_BLENDOPERATION_SUBTRACT,
SDL_BLENDFACTOR_ZERO,
SDL_BLENDFACTOR_ONE,
SDL_BLENDOPERATION_SUBTRACT);


This goes partway to fixing bug 3684 - Add support for a pre-multiplied alpha blending mode

blendMode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE,
SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
SDL_BLENDOPERATION_ADD,
SDL_BLENDFACTOR_ONE,
SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
SDL_BLENDOPERATION_ADD);

Sun, 13 Aug 2017 22:50:23 -0700Fixed bug 2646 - Problems with software renderer when SDL_SetRenderLogicalSize set
Sam Lantinga <slouken@libsdl.org> [Sun, 13 Aug 2017 22:50:23 -0700] rev 11281
Fixed bug 2646 - Problems with software renderer when SDL_SetRenderLogicalSize set

Fixed setting the software renderer clip rectangle when a viewport is set

Sun, 13 Aug 2017 22:26:44 -0700Added wchar.h to fix build on some platforms with new wcs* functions
Sam Lantinga <slouken@libsdl.org> [Sun, 13 Aug 2017 22:26:44 -0700] rev 11280
Added wchar.h to fix build on some platforms with new wcs* functions

Sun, 13 Aug 2017 21:55:42 -0700Fixed bug 2755 - SDL2 fails to build on Solaris 10 u3
Sam Lantinga <slouken@libsdl.org> [Sun, 13 Aug 2017 21:55:42 -0700] rev 11279
Fixed bug 2755 - SDL2 fails to build on Solaris 10 u3

UX-admin

I am compiling with the Sun Studio 12 u2 compiler. There are multiple issues with the build, but this particular issue appears to be that it is illegal to declare a union of a struct of floats and a float. While GCC 4.8.1 does not flag this as an error, Sun Studio is much more standards compliant and strict, halting further compilation with an error.