Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Don't crash when resizing non-shaped windows
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Dec 31, 2010
1 parent 0d824c2 commit f484449
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/video/cocoa/SDL_cocoawindow.m
Expand Up @@ -117,7 +117,8 @@ - (void)windowDidResize:(NSNotification *)aNotification
NSRect rect = [_data->nswindow contentRectForFrameRect:[_data->nswindow frame]];
w = (int)rect.size.width;
h = (int)rect.size.height;
Cocoa_ResizeWindowShape(_data->window);
if (SDL_IsShapedWindow(_data->window))
Cocoa_ResizeWindowShape(_data->window);
SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_RESIZED, w, h);
}

Expand Down
2 changes: 1 addition & 1 deletion src/video/x11/SDL_x11window.c
Expand Up @@ -942,7 +942,7 @@ X11_SetWindowSize(_THIS, SDL_Window * window)
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
Display *display = data->videodata->display;

if(SDL_IsShapedWindow(window))
if (SDL_IsShapedWindow(window))
X11_ResizeWindowShape(window);
XResizeWindow(display, data->xwindow, window->w, window->h);
}
Expand Down

0 comments on commit f484449

Please sign in to comment.