Ryujinx-SDL/src
Sam Lantinga 54685787ca Fixed bug 3847 - Hit Test x coordinate wrong on secondary monitor
Robert Turner

SDL_windowsevents.c contains code to retrieve the x and y coordinate for a requested hit test. It does this as follows:

    POINT winpoint = { (int) LOWORD(lParam), (int) HIWORD(lParam) };

LOWORD(lParam) does not correctly mask off high bits that are set if the point is on a second (or third, etc.) monitor. This effectively offsets the x-coordinate by a large value.

MSDN documentation suggests that LOWORD() and HIWORD() are the wrong macros for the task, instead suggesting we should be doing something like the following:

    POINT winpoint = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };

Testing this change on my Windows 10 machine with 2 monitors gives the correct results.
2017-09-26 15:07:35 -07:00
..
atomic Add atomics for Watcom/x86 as inline asm 2017-08-18 16:35:55 -04:00
audio audio: Fixed compiler warning on Visual Studio. 2017-09-22 22:28:21 -04:00
core Separated out SDL Android java code so audio, controller, and filesystem APIs can be used independently of the SDL activity, in Qt apps for example. 2017-09-22 08:30:46 -07:00
cpuinfo SDL_cpuinfo.c: add os/2 support to SDL_GetCPUCount() and SDL_GetSystemRAM(). 2017-08-21 13:00:40 -07:00
dynapi vulkan: use "unsigned int" instead of "unsigned" 2017-09-06 19:35:36 -04:00
events Fixed mingw Windows build, since SDL_vulkan_internal.h includes windows.h 2017-08-28 00:43:14 -07:00
file Fixed bug 3760 - RWops doesn't check for integer overflow when stdio_fseek only supports 32 bits 2017-09-09 08:36:37 -07:00
filesystem filesystem: Patched to compile on QNX. 2017-08-17 03:22:44 -04:00
haptic Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
joystick Added stubs for simple Steam Controller support 2017-09-22 08:32:31 -07:00
libm Updated copyright for 2017 2017-01-01 18:33:28 -08:00
loadso Updated copyright for 2017 2017-01-01 18:33:28 -08:00
main Removed the need for libSDL2main.a on Android, and separated JNI initialization out for other integrations 2017-08-28 14:34:15 -07:00
power power: whoops, that should be "==" not "!=". 2017-07-03 16:45:12 -04:00
render Fixed bug 3788 - software renderer crashes in SDL_RenderCopyEx with rotation and dstrect w or h is 0 2017-09-21 01:22:40 -07:00
stdlib Fixed bug 3813 - gcc7 fallthrough warnings in SDL_iconv.c and SDL_pixels.c 2017-09-10 12:42:38 -07:00
test Added an example for SDL_SetWindowHitTest() when you create a borderless resizable window. 2017-09-22 17:29:32 -07:00
thread Renaming of guard header names to quiet -Wreserved-id-macro 2017-08-28 00:22:23 -07:00
timer Fixed bug 3745 - specify SDLCALL as the calling convention for API callbacks 2017-08-14 06:28:21 -07:00
video Fixed bug 3847 - Hit Test x coordinate wrong on secondary monitor 2017-09-26 15:07:35 -07:00
SDL_assert_c.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_assert.c Fixed bug 3744 - missing SDLCALL in several functions 2017-08-13 21:06:52 -07:00
SDL_dataqueue.c Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_dataqueue.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_error_c.h Updated copyright for 2017 2017-01-01 18:33:28 -08:00
SDL_error.c Fixed bug 3696 - SDL_ShowMessageBox displays different error from intended 2017-07-10 17:16:12 -07:00
SDL_hints.c A hint with an empty string should be treated as the default value 2017-09-21 14:48:03 -07:00
SDL_internal.h Some patches to make SDL compile with armcc (ARM's C compiler). 2017-03-02 13:33:04 -05:00
SDL_log.c Fixed bug 3745 - specify SDLCALL as the calling convention for API callbacks 2017-08-14 06:28:21 -07:00
SDL.c Backing out broken change from previous commit. 2017-04-01 00:46:42 -04:00