Fixed sending a size event while setting up a window (fix for DOTA 2 on Source 2)
authorSam Lantinga <slouken@libsdl.org>
Tue, 06 Oct 2015 21:16:21 -0700
changeset 9888bf49de980798
parent 9887 77f017f7f16d
child 9889 7cb2c3ec8205
Fixed sending a size event while setting up a window (fix for DOTA 2 on Source 2)
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	Tue Oct 06 00:10:54 2015 -0400
     1.2 +++ b/src/video/windows/SDL_windowsevents.c	Tue Oct 06 21:16:21 2015 -0700
     1.3 @@ -735,7 +735,7 @@
     1.4              int x, y;
     1.5              int w, h;
     1.6              
     1.7 -            if (data->in_border_change) {
     1.8 +            if (data->initializing || data->in_border_change) {
     1.9                  break;
    1.10              }
    1.11  
     2.1 --- a/src/video/windows/SDL_windowswindow.c	Tue Oct 06 00:10:54 2015 -0400
     2.2 +++ b/src/video/windows/SDL_windowswindow.c	Tue Oct 06 21:16:21 2015 -0700
     2.3 @@ -130,6 +130,7 @@
     2.4      data->created = created;
     2.5      data->mouse_button_flags = 0;
     2.6      data->videodata = videodata;
     2.7 +	data->initializing = SDL_TRUE;
     2.8  
     2.9      window->driverdata = data;
    2.10  
    2.11 @@ -255,6 +256,8 @@
    2.12      /* Enable dropping files */
    2.13      DragAcceptFiles(hwnd, TRUE);
    2.14  
    2.15 +	data->initializing = SDL_FALSE;
    2.16 +
    2.17      /* All done! */
    2.18      return 0;
    2.19  }
     3.1 --- a/src/video/windows/SDL_windowswindow.h	Tue Oct 06 00:10:54 2015 -0400
     3.2 +++ b/src/video/windows/SDL_windowswindow.h	Tue Oct 06 21:16:21 2015 -0700
     3.3 @@ -37,6 +37,7 @@
     3.4      WNDPROC wndproc;
     3.5      SDL_bool created;
     3.6      WPARAM mouse_button_flags;
     3.7 +	SDL_bool initializing;
     3.8      SDL_bool expected_resize;
     3.9      SDL_bool in_border_change;
    3.10      SDL_bool in_title_click;