• Show log

    Commit

  • Hash : 54685787
    Author : Sam Lantinga
    Date : 2017-09-26T15:07:35

    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.
    

  • Properties

  • Git HTTP https://git.kmx.io/kc3-lang/SDL.git
    Git SSH git@git.kmx.io:kc3-lang/SDL.git
    Public access ? public
    Description

    Fork of https://github.com/libsdl-org/SDL

    Users
    thodg_m kc3_lang_org thodg_w www_kmx_io thodg thodg_l
    Tags