From dec7875a6e23212021e4d9080330a42832dfe02a Mon Sep 17 00:00:00 2001
From: Edward Rudd <urkle@outoforder.cc>
Date: Tue, 15 Jun 2021 01:40:19 +0000
Subject: [PATCH] update SDL soruce to 2.0.14
---
source/src/events/SDL_mouse.c | 38 ++++++++++++++++++++++----------------
1 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/source/src/events/SDL_mouse.c b/source/src/events/SDL_mouse.c
index 5d6f7dc..11d9f5a 100644
--- a/source/src/events/SDL_mouse.c
+++ b/source/src/events/SDL_mouse.c
@@ -22,7 +22,6 @@
/* General mouse handling code for SDL */
-#include "SDL_assert.h"
#include "SDL_hints.h"
#include "SDL_timer.h"
#include "SDL_events.h"
@@ -31,6 +30,10 @@
#include "../video/SDL_sysvideo.h"
#ifdef __WIN32__
#include "../core/windows/SDL_windows.h" // For GetDoubleClickTime()
+#endif
+#if defined(__OS2__)
+#define INCL_WIN
+#include <os2.h>
#endif
/* #define DEBUG_MOUSE */
@@ -54,6 +57,8 @@
} else {
#ifdef __WIN32__
mouse->double_click_time = GetDoubleClickTime();
+#elif defined(__OS2__)
+ mouse->double_click_time = WinQuerySysValue(HWND_DESKTOP, SV_DBLCLKTIME);
#else
mouse->double_click_time = 500;
#endif
@@ -722,23 +727,24 @@
SDL_GetGlobalMouseState(int *x, int *y)
{
SDL_Mouse *mouse = SDL_GetMouse();
- int tmpx, tmpy;
- /* make sure these are never NULL for the backend implementations... */
- if (!x) {
- x = &tmpx;
+ if (mouse->GetGlobalMouseState) {
+ int tmpx, tmpy;
+
+ /* make sure these are never NULL for the backend implementations... */
+ if (!x) {
+ x = &tmpx;
+ }
+ if (!y) {
+ y = &tmpy;
+ }
+
+ *x = *y = 0;
+
+ return mouse->GetGlobalMouseState(x, y);
+ } else {
+ return SDL_GetMouseState(x, y);
}
- if (!y) {
- y = &tmpy;
- }
-
- *x = *y = 0;
-
- if (!mouse->GetGlobalMouseState) {
- return 0;
- }
-
- return mouse->GetGlobalMouseState(x, y);
}
void
--
Gitblit v1.9.3