sdl: Bump to 1.2.15-p20221028

This commit is contained in:
Tee KOBAYASHI 2022-11-02 10:11:17 +09:00 committed by xtkoba
parent 145201a550
commit bdd3308e6f
5 changed files with 21 additions and 102 deletions

View File

@ -1,13 +0,0 @@
diff -uNr SDL-1.2.15/src/joystick/linux/SDL_sysjoystick.c SDL-1.2.15.mod/src/joystick/linux/SDL_sysjoystick.c
--- SDL-1.2.15/src/joystick/linux/SDL_sysjoystick.c 2012-01-19 08:30:06.000000000 +0200
+++ SDL-1.2.15.mod/src/joystick/linux/SDL_sysjoystick.c 2018-10-26 23:20:45.208724512 +0300
@@ -1106,6 +1106,9 @@
}
break;
case EV_ABS:
+ if (code > ABS_MISC) {
+ break;
+ }
switch (code) {
case ABS_HAT0X:
case ABS_HAT0Y:

View File

@ -14,45 +14,6 @@ diff -uNr SDL-1.2.15/src/video/x11/SDL_x11events.c SDL-1.2.15.mod/src/video/x11/
#ifdef X_HAVE_UTF8_STRING
Uint32 Utf8ToUcs4(const Uint8 *utf8)
@@ -395,6 +389,8 @@
{
int posted;
XEvent xevent;
+ int orig_event_type;
+ KeyCode orig_keycode;
SDL_memset(&xevent, '\0', sizeof (XEvent)); /* valgrind fix. --ryan. */
XNextEvent(SDL_Display, &xevent);
@@ -410,9 +406,29 @@
#ifdef X_HAVE_UTF8_STRING
/* If we are translating with IM, we need to pass all events
to XFilterEvent, and discard those filtered events immediately. */
+ orig_event_type = xevent.type;
+ if (orig_event_type == KeyPress || orig_event_type == KeyRelease) {
+ orig_keycode = xevent.xkey.keycode;
+ } else {
+ orig_keycode = 0;
+ }
if ( SDL_TranslateUNICODE
&& SDL_IM != NULL
&& XFilterEvent(&xevent, None) ) {
+ if (orig_keycode) {
+ SDL_keysym keysym;
+ static XComposeStatus state;
+ char keybuf[32];
+
+ keysym.scancode = xevent.xkey.keycode;
+ keysym.sym = X11_TranslateKeycode(SDL_Display, xevent.xkey.keycode);
+ keysym.mod = KMOD_NONE;
+ keysym.unicode = 0;
+ if (orig_event_type == KeyPress && XLookupString(&xevent.xkey, keybuf, sizeof(keybuf), NULL, &state))
+ keysym.unicode = (Uint8)keybuf[0];
+
+ SDL_PrivateKeyboard(orig_event_type == KeyPress ? SDL_PRESSED : SDL_RELEASED, &keysym);
+ }
return 0;
}
#endif
@@ -429,12 +445,15 @@
if ( xevent.xcrossing.mode == NotifyUngrab )
printf("Mode: NotifyUngrab\n");
@ -80,8 +41,8 @@ diff -uNr SDL-1.2.15/src/video/x11/SDL_x11events.c SDL-1.2.15.mod/src/video/x11/
#endif
- if ((X11_PendingConfigureNotifyWidth != -1) &&
- (X11_PendingConfigureNotifyHeight != -1)) {
- if ((xevent.xconfigure.width != X11_PendingConfigureNotifyWidth) &&
- (xevent.xconfigure.height != X11_PendingConfigureNotifyHeight)) {
- if ((xevent.xconfigure.width == X11_PendingConfigureNotifyWidth) &&
- (xevent.xconfigure.height == X11_PendingConfigureNotifyHeight)) {
- /* Event is from before the resize, so ignore. */
- break;
- }
@ -91,18 +52,6 @@ diff -uNr SDL-1.2.15/src/video/x11/SDL_x11events.c SDL-1.2.15.mod/src/video/x11/
if ( SDL_VideoSurface ) {
if ((xevent.xconfigure.width != SDL_VideoSurface->w) ||
(xevent.xconfigure.height != SDL_VideoSurface->h)) {
@@ -1246,8 +1255,11 @@
* sequences (dead accents, compose key sequences) will not work since the
* state has been irrevocably lost.
*/
+extern DECLSPEC Uint16 SDLCALL X11_KeyToUnicode(SDLKey, SDLMod);
+
Uint16 X11_KeyToUnicode(SDLKey keysym, SDLMod modifiers)
{
+ static int warning = 0;
struct SDL_VideoDevice *this = current_video;
char keybuf[32];
int i;
@@ -1255,6 +1267,12 @@
XKeyEvent xkey;
Uint16 unicode;

View File

@ -1,12 +0,0 @@
diff -uNr SDL-1.2.15/src/video/x11/SDL_x11sym.h SDL-1.2.15.mod/src/video/x11/SDL_x11sym.h
--- SDL-1.2.15/src/video/x11/SDL_x11sym.h 2012-01-19 08:30:06.000000000 +0200
+++ SDL-1.2.15.mod/src/video/x11/SDL_x11sym.h 2018-10-26 23:20:45.232058046 +0300
@@ -165,7 +165,7 @@
*/
#ifdef LONG64
SDL_X11_MODULE(IO_32BIT)
-SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
+SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return)
SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
#endif

View File

@ -1,19 +0,0 @@
diff -uNr SDL-1.2.15/src/video/x11/SDL_x11wm.c SDL-1.2.15.mod/src/video/x11/SDL_x11wm.c
--- SDL-1.2.15/src/video/x11/SDL_x11wm.c 2012-01-19 08:30:06.000000000 +0200
+++ SDL-1.2.15.mod/src/video/x11/SDL_x11wm.c 2018-10-26 23:20:45.235391408 +0300
@@ -352,13 +352,14 @@
result = XGrabPointer(SDL_Display, SDL_Window, True, 0,
GrabModeAsync, GrabModeAsync,
SDL_Window, None, CurrentTime);
- if ( result == GrabSuccess ) {
+ if ( result == GrabSuccess || result == GrabNotViewable ) {
break;
}
SDL_Delay(100);
}
if ( result != GrabSuccess ) {
/* Uh, oh, what do we do here? */ ;
+ return(SDL_GRAB_OFF);
}
/* Now grab the keyboard */
XGrabKeyboard(SDL_Display, WMwindow, True,

View File

@ -2,11 +2,12 @@ TERMUX_PKG_HOMEPAGE=https://www.libsdl.org
TERMUX_PKG_DESCRIPTION="A library for portable low-level access to a video framebuffer, audio output, mouse, and keyboard"
TERMUX_PKG_LICENSE="LGPL-2.1"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.2.15
TERMUX_PKG_REVISION=48
TERMUX_PKG_SRCURL=https://www.libsdl.org/release/SDL-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=d6d316a793e5e348155f0dd93b979798933fb98aa1edebcc108829d6474aad00
TERMUX_PKG_DEPENDS="libandroid-glob, libflac, libogg, libsndfile, libvorbis, libx11, libxext, libxrandr, libxrender, pulseaudio"
_COMMIT=d95c1a4bbd644baba748d341b03141e5f0481ae6
_COMMIT_DATE=20221028
TERMUX_PKG_VERSION=1.2.15-p${_COMMIT_DATE}
TERMUX_PKG_SRCURL=https://github.com/libsdl-org/SDL-1.2.git
TERMUX_PKG_GIT_BRANCH=main
TERMUX_PKG_DEPENDS="libiconv, libx11, libxext, libxrandr, libxrender, pulseaudio"
TERMUX_PKG_BUILD_DEPENDS="glu, mesa"
TERMUX_PKG_RECOMMENDS="mesa"
TERMUX_PKG_CONFLICTS="libsdl"
@ -18,3 +19,16 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--disable-pth
--enable-video-opengl
"
termux_step_post_get_source() {
git fetch --unshallow
git checkout $_COMMIT
local pdate="p$(git log -1 --format=%cs | sed 's/-//g')"
if [[ "$TERMUX_PKG_VERSION" != *"${pdate}" ]]; then
echo -n "ERROR: The version string \"$TERMUX_PKG_VERSION\" is"
echo -n " different from what is expected to be; should end"
echo " with \"${pdate}\"."
return 1
fi
}