[mupen64plus-core] 265/310: Close SDL2 window when quitting Video subsystem

Sven Eckelmann ecsv-guest at moszumanska.debian.org
Thu Nov 26 05:58:15 UTC 2015


This is an automated email from the git hooks/post-receive script.

ecsv-guest pushed a commit to branch armhf_test
in repository mupen64plus-core.

commit 59b397cebe3c2ec8f9685ae6aeb5ab0792a1a9a1
Author: Sven Eckelmann <sven at narfation.org>
Date:   Thu Jan 23 14:39:02 2014 +0100

    Close SDL2 window when quitting Video subsystem
    
    SDL2 doesn't close windows anymore when the video subsystem is closed.
    Therefore, the window created by the SDL2 compat layer has to be closed
    manually to avoid orphan windows in frontends like m64py in non-VidExt mode.
---
 debian/changelog                        |  2 ++
 debian/patches/sdl2_destroywindow.patch | 42 +++++++++++++++++++++++++++++++++
 debian/patches/series                   |  1 +
 3 files changed, 45 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index a9067bd..41d7474 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ mupen64plus-core (2.0-5) UNRELEASED; urgency=medium
     - Add countperop_rominfo.patch, Allow to load CountPerOp info from
       mupen64plus.ini
     - Add countperop_romdb.patch, Add CountPerOp info to mupen64plus.ini
+    - Add sdl2_destroywindow.patch, Close SDL2 window when quitting Video
+      subsystem
   * debian/watch:
     - Change upstream check from bitbucket to github
   * debian/copyright:
diff --git a/debian/patches/sdl2_destroywindow.patch b/debian/patches/sdl2_destroywindow.patch
new file mode 100644
index 0000000..1ce5b2b
--- /dev/null
+++ b/debian/patches/sdl2_destroywindow.patch
@@ -0,0 +1,42 @@
+Description: Close SDL2 window when quitting Video subsystem
+ SDL2 doesn't close windows anymore when the video subsystem is closed.
+ Therefore, the window created by the SDL2 compat layer has to be closed
+ manually to avoid orphan windows in frontends like m64py in non-VidExt mode.
+Author: Sven Eckelmann <sven at narfation.org>
+
+---
+diff --git a/src/api/vidext.c b/src/api/vidext.c
+index 9af2aaecf18d0b45ba53b3ef6391fa3707d65ede..82b43abd61fb42e78f8d1926628eebbbee1233da 100644
+--- a/src/api/vidext.c
++++ b/src/api/vidext.c
+@@ -123,6 +123,30 @@ EXPORT m64p_error CALL VidExt_Quit(void)
+         return M64ERR_NOT_INIT;
+ 
+     SDL_ShowCursor(SDL_ENABLE);
++#if SDL_VERSION_ATLEAST(2,0,0)
++    /* Destroy existing window */
++    SDL_PublicSurface = NULL;
++    if (SDL_ShadowSurface) {
++        SDL_ShadowSurface->flags &= ~SDL_DONTFREE;
++        SDL_FreeSurface(SDL_ShadowSurface);
++        SDL_ShadowSurface = NULL;
++    }
++    if (SDL_VideoSurface) {
++        SDL_VideoSurface->flags &= ~SDL_DONTFREE;
++        SDL_FreeSurface(SDL_VideoSurface);
++        SDL_VideoSurface = NULL;
++    }
++    if (SDL_VideoContext) {
++        /* SDL_GL_MakeCurrent(0, NULL); *//* Doesn't do anything */
++        SDL_GL_DeleteContext(SDL_VideoContext);
++        SDL_VideoContext = NULL;
++    }
++    if (SDL_VideoWindow) {
++        SDL_DestroyWindow(SDL_VideoWindow);
++	SDL_VideoWindow = NULL;
++    }
++    initialized_video = 0;
++#endif
+     SDL_QuitSubSystem(SDL_INIT_VIDEO);
+     l_pScreen = NULL;
+     l_VideoOutputActive = 0;
diff --git a/debian/patches/series b/debian/patches/series
index 8fbde0d..ae3a0a9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -16,3 +16,4 @@ format_eeprom.patch
 revert_wii64_eeprom.patch
 countperop_rominfo.patch
 countperop_romdb.patch
+sdl2_destroywindow.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus-core.git



More information about the Pkg-games-commits mailing list