Skip to content

Commit

Permalink
Fixed sending a size event while setting up a window (fix for DOTA 2 …
Browse files Browse the repository at this point in the history
…on Source 2)
  • Loading branch information
slouken committed Oct 7, 2015
1 parent c5e68d6 commit 9bd640e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/video/windows/SDL_windowsevents.c
Expand Up @@ -735,7 +735,7 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
int x, y;
int w, h;

if (data->in_border_change) {
if (data->initializing || data->in_border_change) {
break;
}

Expand Down
3 changes: 3 additions & 0 deletions src/video/windows/SDL_windowswindow.c
Expand Up @@ -130,6 +130,7 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
data->created = created;
data->mouse_button_flags = 0;
data->videodata = videodata;
data->initializing = SDL_TRUE;

window->driverdata = data;

Expand Down Expand Up @@ -255,6 +256,8 @@ SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
/* Enable dropping files */
DragAcceptFiles(hwnd, TRUE);

data->initializing = SDL_FALSE;

/* All done! */
return 0;
}
Expand Down
1 change: 1 addition & 0 deletions src/video/windows/SDL_windowswindow.h
Expand Up @@ -37,6 +37,7 @@ typedef struct
WNDPROC wndproc;
SDL_bool created;
WPARAM mouse_button_flags;
SDL_bool initializing;
SDL_bool expected_resize;
SDL_bool in_border_change;
SDL_bool in_title_click;
Expand Down

0 comments on commit 9bd640e

Please sign in to comment.