Explorar o código

cocoa: Convert popup window coordinates to global when adjusting the pointer offset

Fixes a regression in 958c4cbf0d77182254101670e01afd3b09207b7e
Frank Praznik hai 2 semanas
pai
achega
013844b003
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      src/video/cocoa/SDL_cocoawindow.m

+ 1 - 0
src/video/cocoa/SDL_cocoawindow.m

@@ -1929,6 +1929,7 @@ static void Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL
         //if ([_data.listener isInFullscreenSpace]) {
         //if ([_data.listener isInFullscreenSpace]) {
             int posx = 0, posy = 0;
             int posx = 0, posy = 0;
             SDL_GetWindowPosition(window, &posx, &posy);
             SDL_GetWindowPosition(window, &posx, &posy);
+            SDL_RelativeToGlobalForWindow(window, posx, posy, &posx, &posy);
             SDL_GetGlobalMouseState(&x, &y);
             SDL_GetGlobalMouseState(&x, &y);
             x -= posx;
             x -= posx;
             y -= posy;
             y -= posy;