From d4a70efa46679c1aba2741f36bc794507005144f Mon Sep 17 00:00:00 2001
From: Oliver Behnke <oliver.behnke@aei.mpg.de>
Date: Thu, 5 Mar 2020 11:27:44 +0000
Subject: [PATCH] Fix up SDL patch for latest SDL version

---
 build.sh                          |  4 ++--
 patches/SDL_sysevents.c.patch     | 11 -----------
 patches/SDL_windowsevents.c.patch | 11 +++++++++++
 3 files changed, 13 insertions(+), 13 deletions(-)
 delete mode 100644 patches/SDL_sysevents.c.patch
 create mode 100644 patches/SDL_windowsevents.c.patch

diff --git a/build.sh b/build.sh
index 900523f..8267a5c 100755
--- a/build.sh
+++ b/build.sh
@@ -538,9 +538,9 @@ build_sdl_mingw()
     prepare_sdl || failure
 
     echo "Patching SDL..." | tee -a $LOGFILE
-    cd $ROOT/3rdparty/sdl/src/video/wincommon || failure
+    cd $ROOT/3rdparty/sdl/src/video/windows || failure
     # patch: amend window class name (required by BOINC v6 screensaver!)
-    patch < $ROOT/patches/SDL_sysevents.c.patch >> $LOGFILE 2>&1 || failure
+    patch < $ROOT/patches/SDL_windowsevents.c.patch >> $LOGFILE 2>&1 || failure
     echo "Building SDL (this may take a while)..." | tee -a $LOGFILE
     cd $ROOT/3rdparty/sdl || failure
     chmod +x autogen.sh >> $LOGFILE 2>&1 || failure
diff --git a/patches/SDL_sysevents.c.patch b/patches/SDL_sysevents.c.patch
deleted file mode 100644
index 3840748..0000000
--- a/patches/SDL_sysevents.c.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- SDL_sysevents.c	2009-04-17 17:18:07.000000000 +0200
-+++ SDL_sysevents.c.new	2009-04-17 17:14:41.000000000 +0200
-@@ -799,7 +799,7 @@
- #define CS_BYTEALIGNCLIENT	0
- #endif
- 	if ( ! name && ! SDL_Appname ) {
--		name = "SDL_app";
-+		name = "BOINC_app";
- 		SDL_Appstyle = CS_BYTEALIGNCLIENT;
- 		SDL_Instance = hInst ? hInst : SDL_GetModuleHandle();
- 	}
diff --git a/patches/SDL_windowsevents.c.patch b/patches/SDL_windowsevents.c.patch
new file mode 100644
index 0000000..89e1a6f
--- /dev/null
+++ b/patches/SDL_windowsevents.c.patch
@@ -0,0 +1,11 @@
+--- SDL_windowsevents.c	2020-03-05 10:46:34.201154000 +0000
++++ SDL_windowsevents.c	2020-03-05 10:54:16.394363000 +0000
+@@ -1211,7 +1211,7 @@
+         return (0);
+     }
+     if (!name && !SDL_Appname) {
+-        name = "SDL_app";
++        name = "BOINC_app";
+ #if defined(CS_BYTEALIGNCLIENT) || defined(CS_OWNDC)
+         SDL_Appstyle = (CS_BYTEALIGNCLIENT | CS_OWNDC);
+ #endif
-- 
GitLab