Merge back from upstream MG-SDL2