From 42a8be64a8dedd297eea1701fb1cd8e60d6fccd46112354d937072673a4370cf Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 5 Jul 2022 09:16:55 +0000 Subject: [PATCH] - Add fix-xi2-crash.patch OBS-URL: https://build.opensuse.org/package/show/games/SDL2?expand=0&rev=127 --- SDL2.changes | 5 ++++ SDL2.spec | 7 +++-- fix-xi2-crash.patch | 67 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 fix-xi2-crash.patch diff --git a/SDL2.changes b/SDL2.changes index 64ebd2c..dcea25d 100644 --- a/SDL2.changes +++ b/SDL2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jul 5 09:16:41 UTC 2022 - Jan Engelhardt + +- Add fix-xi2-crash.patch + ------------------------------------------------------------------- Fri Apr 29 20:53:29 UTC 2022 - Jan Engelhardt diff --git a/SDL2.spec b/SDL2.spec index def37ec..820a22c 100644 --- a/SDL2.spec +++ b/SDL2.spec @@ -33,6 +33,7 @@ Source3: %name.keyring Source4: baselibs.conf Patch1: sdl2-symvers.patch Patch2: sdl2-khronos.patch +Patch3: fix-xi2-crash.patch BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: nasm @@ -87,6 +88,9 @@ This is the "Simple DirectMedia Layer" library. It provides a generic API for access to audio, keyboard, mouse, and display framebuffer across multiple platforms. +SDL2 uses dlopen, so if you experience problems under X11, check +again that libXrandr2 and libXi6 are in fact installed. + %package -n libSDL2-devel Summary: SDL2 Library Developer Files Group: Development/Libraries/X11 @@ -120,8 +124,7 @@ perl -i -pe 's{\r\n}{\n}g' *.txt README.md %ifarch ix86 --enable-sse2=no \ %endif - --enable-sse3=no --disable-rpath --disable-3dnow \ - CFLAGS="%optflags -fcommon" + --enable-sse3=no --disable-rpath --disable-3dnow %make_build %install diff --git a/fix-xi2-crash.patch b/fix-xi2-crash.patch new file mode 100644 index 0000000..6a12a2e --- /dev/null +++ b/fix-xi2-crash.patch @@ -0,0 +1,67 @@ +From fdb86b8266947e225f058b32ebb77fa949f6ae42 Mon Sep 17 00:00:00 2001 +From: "Ryan C. Gordon" +Date: Mon, 4 Jul 2022 12:48:32 -0400 +Subject: [PATCH] x11: Don't try to use XInput2 multitouch if not supported. + +Fixes #5889. +--- + src/video/x11/SDL_x11touch.c | 4 +--- + src/video/x11/SDL_x11xinput2.c | 13 +++++++++++++ + 2 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/src/video/x11/SDL_x11touch.c b/src/video/x11/SDL_x11touch.c +index 958bee9df..c608cf24d 100644 +--- a/src/video/x11/SDL_x11touch.c ++++ b/src/video/x11/SDL_x11touch.c +@@ -31,9 +31,7 @@ + void + X11_InitTouch(_THIS) + { +- if (X11_Xinput2IsMultitouchSupported()) { +- X11_InitXinput2Multitouch(_this); +- } ++ X11_InitXinput2Multitouch(_this); + } + + void +diff --git a/src/video/x11/SDL_x11xinput2.c b/src/video/x11/SDL_x11xinput2.c +index abfbdf0e3..21d8bd6c1 100644 +--- a/src/video/x11/SDL_x11xinput2.c ++++ b/src/video/x11/SDL_x11xinput2.c +@@ -265,6 +265,11 @@ X11_InitXinput2Multitouch(_THIS) + SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; + XIDeviceInfo *info; + int ndevices,i,j; ++ ++ if (!X11_Xinput2IsMultitouchSupported()) { ++ return; ++ } ++ + info = X11_XIQueryDevice(data->display, XIAllDevices, &ndevices); + + for (i = 0; i < ndevices; i++) { +@@ -354,6 +359,10 @@ X11_Xinput2GrabTouch(_THIS, SDL_Window *window) + XIGrabModifiers mods; + XIEventMask eventmask; + ++ if (!X11_Xinput2IsMultitouchSupported()) { ++ return; ++ } ++ + mods.modifiers = XIAnyModifier; + mods.status = 0; + +@@ -379,6 +388,10 @@ X11_Xinput2UngrabTouch(_THIS, SDL_Window *window) + + XIGrabModifiers mods; + ++ if (!X11_Xinput2IsMultitouchSupported()) { ++ return; ++ } ++ + mods.modifiers = XIAnyModifier; + mods.status = 0; + +-- +2.36.1 +