src/video/cocoa/SDL_cocoamouse.m
changeset 9691 c0ca56ba6749
parent 9619 b94b6d0bff0f
child 9692 1982dc994254
equal deleted inserted replaced
9690:eb38e9960b05 9691:c0ca56ba6749
   228 }
   228 }
   229 
   229 
   230 static void
   230 static void
   231 Cocoa_WarpMouse(SDL_Window * window, int x, int y)
   231 Cocoa_WarpMouse(SDL_Window * window, int x, int y)
   232 {
   232 {
       
   233     /* pretend we have the mouse focus, even if we don't, so
       
   234         Cocoa_WarpMouseGlobal() will properly fake a mouse motion event. */
       
   235     SDL_Mouse *mouse = SDL_GetMouse();
       
   236     mouse->focus = window;
   233     Cocoa_WarpMouseGlobal(x + window->x, y + window->y);
   237     Cocoa_WarpMouseGlobal(x + window->x, y + window->y);
   234 }
   238 }
   235 
   239 
   236 static int
   240 static int
   237 Cocoa_SetRelativeMouseMode(SDL_bool enabled)
   241 Cocoa_SetRelativeMouseMode(SDL_bool enabled)