Don't crash when resizing non-shaped windows
authorSam Lantinga
Fri, 31 Dec 2010 08:50:06 -0800
changeset 493724d44c7c4c63
parent 4936 e99358ca7a8d
child 4938 2af0032520d8
Don't crash when resizing non-shaped windows
src/video/cocoa/SDL_cocoawindow.m
src/video/x11/SDL_x11window.c
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Fri Dec 31 08:42:47 2010 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Fri Dec 31 08:50:06 2010 -0800
     1.3 @@ -117,7 +117,8 @@
     1.4      NSRect rect = [_data->nswindow contentRectForFrameRect:[_data->nswindow frame]];
     1.5      w = (int)rect.size.width;
     1.6      h = (int)rect.size.height;
     1.7 -    Cocoa_ResizeWindowShape(_data->window);
     1.8 +    if (SDL_IsShapedWindow(_data->window))
     1.9 +        Cocoa_ResizeWindowShape(_data->window);
    1.10      SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_RESIZED, w, h);
    1.11  }
    1.12  
     2.1 --- a/src/video/x11/SDL_x11window.c	Fri Dec 31 08:42:47 2010 -0800
     2.2 +++ b/src/video/x11/SDL_x11window.c	Fri Dec 31 08:50:06 2010 -0800
     2.3 @@ -942,7 +942,7 @@
     2.4      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
     2.5      Display *display = data->videodata->display;
     2.6  
     2.7 -    if(SDL_IsShapedWindow(window))
     2.8 +    if (SDL_IsShapedWindow(window))
     2.9          X11_ResizeWindowShape(window);
    2.10      XResizeWindow(display, data->xwindow, window->w, window->h);
    2.11  }