diff --git a/helpers/DATA/pygame/update_surface_test.patch b/helpers/DATA/pygame/01_update_surface_test.patch similarity index 100% rename from helpers/DATA/pygame/update_surface_test.patch rename to helpers/DATA/pygame/01_update_surface_test.patch diff --git a/helpers/DATA/pygame/02_c105540bb10df5d29a101f593f2a3801c1fa0799.patch b/helpers/DATA/pygame/02_c105540bb10df5d29a101f593f2a3801c1fa0799.patch new file mode 100644 index 0000000..1c47b70 --- /dev/null +++ b/helpers/DATA/pygame/02_c105540bb10df5d29a101f593f2a3801c1fa0799.patch @@ -0,0 +1,26 @@ +From c105540bb10df5d29a101f593f2a3801c1fa0799 Mon Sep 17 00:00:00 2001 +From: gernot steinegger +Date: Sun, 9 Jan 2022 13:01:25 +0100 +Subject: [PATCH] "SDL_CreateWindowFrom" in "display" module + +if the environment variable "SDL_WINDOWID" is set, use "SDL_CreateWindowFrom" to create the window in "display.set_mode" +--- + src_c/display.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src_c/display.c b/src_c/display.c +index d37c29765a..26f07f77e9 100644 +--- a/src_c/display.c ++++ b/src_c/display.c +@@ -1096,7 +1096,10 @@ pg_set_mode(PyObject *self, PyObject *arg, PyObject *kwds) + + if (!win) { + /*open window*/ +- win = SDL_CreateWindow(title, x, y, w_1, h_1, sdl_flags); ++ const char *window_handle = SDL_getenv("SDL_WINDOWID"); ++ win = window_handle ++ ? SDL_CreateWindowFrom((const void*)atoll(window_handle)) ++ : SDL_CreateWindow(title, x, y, w_1, h_1, sdl_flags); + if (!win) + return RAISE(pgExc_SDLError, SDL_GetError()); + init_flip = 1; diff --git a/helpers/make-pygame b/helpers/make-pygame index 1489c3b..015dc37 100644 --- a/helpers/make-pygame +++ b/helpers/make-pygame @@ -17,13 +17,19 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -VERSION=0 +VERSION=1 BUILD_UNTIL=11.0 . ./config -patch --no-backup-if-mismatch -p1 < $DATA/update_surface_test.patch +# 01_Rebuild to use the latest SDL support on aramo. +# 02_SDL_CreateWindowFrom in "display" module +for patch in $(ls -v ${DATA}/*.patch) +do + echo "Applying $patch" + patch --no-backup-if-mismatch -Np1 < $patch +done -changelog "Rebuild to use the latest SDL support on aramo." +changelog "Rebuild to use the latest SDL support on aramo. | Fix 'SDL_CreateWindowFrom' in 'display' module" package