Make sure we don't clip the cursor while clicking on the window title bar
authorSam Lantinga <slouken@libsdl.org>
Mon, 24 Feb 2014 22:49:30 -0800
changeset 825375ad8ebb3768
parent 8252 3e4846dc97b1
child 8254 f97b5166c158
Make sure we don't clip the cursor while clicking on the window title bar
src/video/windows/SDL_windowsevents.c
src/video/windows/SDL_windowswindow.c
src/video/windows/SDL_windowswindow.h
     1.1 --- a/src/video/windows/SDL_windowsevents.c	Mon Feb 24 22:37:58 2014 -0800
     1.2 +++ b/src/video/windows/SDL_windowsevents.c	Mon Feb 24 22:49:30 2014 -0800
     1.3 @@ -570,6 +570,20 @@
     1.4          break;
     1.5  #endif /* WM_INPUTLANGCHANGE */
     1.6  
     1.7 +    case WM_NCLBUTTONDOWN:
     1.8 +        {
     1.9 +            data->in_title_click = SDL_TRUE;
    1.10 +            WIN_UpdateClipCursor(data->window);
    1.11 +        }
    1.12 +        break;
    1.13 +
    1.14 +    case WM_NCMOUSELEAVE:
    1.15 +        {
    1.16 +            data->in_title_click = SDL_FALSE;
    1.17 +            WIN_UpdateClipCursor(data->window);
    1.18 +        }
    1.19 +        break;
    1.20 +
    1.21      case WM_ENTERSIZEMOVE:
    1.22      case WM_ENTERMENULOOP:
    1.23          {
     2.1 --- a/src/video/windows/SDL_windowswindow.c	Mon Feb 24 22:37:58 2014 -0800
     2.2 +++ b/src/video/windows/SDL_windowswindow.c	Mon Feb 24 22:49:30 2014 -0800
     2.3 @@ -746,7 +746,7 @@
     2.4      SDL_Mouse *mouse = SDL_GetMouse();
     2.5  
     2.6      /* Don't clip the cursor while we're in the modal resize or move loop */
     2.7 -    if (data->in_modal_loop) {
     2.8 +    if (data->in_title_click || data->in_modal_loop) {
     2.9          ClipCursor(NULL);
    2.10          return;
    2.11      }
     3.1 --- a/src/video/windows/SDL_windowswindow.h	Mon Feb 24 22:37:58 2014 -0800
     3.2 +++ b/src/video/windows/SDL_windowswindow.h	Mon Feb 24 22:49:30 2014 -0800
     3.3 @@ -38,6 +38,7 @@
     3.4      SDL_bool created;
     3.5      WPARAM mouse_button_flags;
     3.6      BOOL expected_resize;
     3.7 +    SDL_bool in_title_click;
     3.8      SDL_bool in_modal_loop;
     3.9      struct SDL_VideoData *videodata;
    3.10  #if SDL_VIDEO_OPENGL_EGL