diff options
author | jmcneill <jmcneill@pkgsrc.org> | 2015-02-25 12:45:59 +0000 |
---|---|---|
committer | jmcneill <jmcneill@pkgsrc.org> | 2015-02-25 12:45:59 +0000 |
commit | b0a8c8d80f8f0e9a56af5f38a1036f4669933902 (patch) | |
tree | 6b51adddd9ebbf30d3253a34e7a80f9d61033f21 /devel/SDL2/patches | |
parent | 95c4c0653e3229893344d47d3292e39ca3e4e594 (diff) | |
download | pkgsrc-b0a8c8d80f8f0e9a56af5f38a1036f4669933902.tar.gz |
flush any pending events from the joystick device when opening on netbsd, bump PKGREVISION
Diffstat (limited to 'devel/SDL2/patches')
-rw-r--r-- | devel/SDL2/patches/patch-src_joystick_bsd_SDL__sysjoystick.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/devel/SDL2/patches/patch-src_joystick_bsd_SDL__sysjoystick.c b/devel/SDL2/patches/patch-src_joystick_bsd_SDL__sysjoystick.c index a9d9f059ff3..78323d5405d 100644 --- a/devel/SDL2/patches/patch-src_joystick_bsd_SDL__sysjoystick.c +++ b/devel/SDL2/patches/patch-src_joystick_bsd_SDL__sysjoystick.c @@ -1,4 +1,4 @@ -$NetBSD: patch-src_joystick_bsd_SDL__sysjoystick.c,v 1.1 2015/02/13 23:31:06 jmcneill Exp $ +$NetBSD: patch-src_joystick_bsd_SDL__sysjoystick.c,v 1.2 2015/02/25 12:45:59 jmcneill Exp $ Skip non-joystick HID devices, and give joysticks on NetBSD a human readable name. @@ -53,7 +53,7 @@ name. if (report_alloc(rep, hw->repdesc, REPORT_INPUT) < 0) { goto usberr; } -@@ -414,6 +446,11 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joy, +@@ -414,9 +446,19 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joy, if (hw->axis_map[i] > 0) hw->axis_map[i] = joy->naxes++; @@ -65,3 +65,11 @@ name. usbend: /* The poll blocks the event thread. */ fcntl(fd, F_SETFL, O_NONBLOCK); ++#ifdef __NetBSD__ ++ /* Flush pending events */ ++ while (read(joy->hwdata->fd, REP_BUF_DATA(rep), rep->size) == rep->size) ++ ; ++#endif + + return (0); + usberr: |