Skip to content

Commit

Permalink
Fixed mouse grab going fullscreen to windowed in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Aug 19, 2002
1 parent ef3d854 commit f734a42
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/video/wincommon/SDL_sysevents.c
Expand Up @@ -438,22 +438,21 @@ LONG CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
return(0);
#endif /* WM_GETMINMAXINFO */

case WM_MOVE: {
case WM_WINDOWPOSCHANGED: {
SDL_VideoDevice *this = current_video;
int w, h;

GetClientRect(SDL_Window, &SDL_bounds);
ClientToScreen(SDL_Window, (LPPOINT)&SDL_bounds);
ClientToScreen(SDL_Window, (LPPOINT)&SDL_bounds+1);
w = SDL_bounds.right-SDL_bounds.left;
h = SDL_bounds.bottom-SDL_bounds.top;
if ( this->input_grab != SDL_GRAB_OFF ) {
ClipCursor(&SDL_bounds);
}
}
break;

case WM_SIZE: {
if ( SDL_PublicSurface &&
if ( SDL_PublicSurface &&
(SDL_PublicSurface->flags & SDL_RESIZABLE) ) {
SDL_PrivateResize(LOWORD(lParam), HIWORD(lParam));
SDL_PrivateResize(w, h);
}
return(0);
}
Expand Down

0 comments on commit f734a42

Please sign in to comment.