diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index cd40aeb48..4088afe81 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1551,14 +1551,21 @@ SDL_SetWindowPosition(SDL_Window * window, int x, int y) } } - if (!SDL_WINDOWPOS_ISUNDEFINED(x)) { - window->x = x; - } - if (!SDL_WINDOWPOS_ISUNDEFINED(y)) { - window->y = y; - } + if ((window->flags & SDL_WINDOW_FULLSCREEN)) { + if (!SDL_WINDOWPOS_ISUNDEFINED(x)) { + window->windowed.x = x; + } + if (!SDL_WINDOWPOS_ISUNDEFINED(y)) { + window->windowed.y = y; + } + } else { + if (!SDL_WINDOWPOS_ISUNDEFINED(x)) { + window->x = x; + } + if (!SDL_WINDOWPOS_ISUNDEFINED(y)) { + window->y = y; + } - if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { if (_this->SetWindowPosition) { _this->SetWindowPosition(_this, window); } diff --git a/src/video/cocoa/SDL_cocoamouse.m b/src/video/cocoa/SDL_cocoamouse.m index faba9618e..e83442346 100644 --- a/src/video/cocoa/SDL_cocoamouse.m +++ b/src/video/cocoa/SDL_cocoamouse.m @@ -204,13 +204,7 @@ static void Cocoa_WarpMouse(SDL_Window * window, int x, int y) { SDL_Mouse *mouse = SDL_GetMouse(); - CGPoint point = CGPointMake(x, y); - - if (!(window->flags & SDL_WINDOW_FULLSCREEN)) - { - point.x += window->x; - point.y += window->y; - } + CGPoint point = CGPointMake(x + (float)window->x, y + (float)window->y); { /* This makes Cocoa_HandleMouseEvent ignore this delta in the next