Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Some fixes for SDL_MaximizeWindow().
- Loading branch information
|
@@ -1756,6 +1756,8 @@ SDL_MaximizeWindow(SDL_Window * window) |
|
|
return; |
|
|
} |
|
|
|
|
|
// !!! FIXME: should this check if the window is resizable? |
|
|
|
|
|
if (_this->MaximizeWindow) { |
|
|
_this->MaximizeWindow(_this, window); |
|
|
} |
|
|
|
@@ -239,6 +239,13 @@ - (void)windowDidResize:(NSNotification *)aNotification |
|
|
or resizing from a corner */ |
|
|
SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_MOVED, x, y); |
|
|
SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_RESIZED, w, h); |
|
|
|
|
|
const BOOL zoomed = [_data->nswindow isZoomed]; |
|
|
if (!zoomed) { |
|
|
SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_RESTORED, 0, 0); |
|
|
} else if (zoomed) { |
|
|
SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_MAXIMIZED, 0, 0); |
|
|
} |
|
|
} |
|
|
|
|
|
- (void)windowDidMiniaturize:(NSNotification *)aNotification |
|
|
|
@@ -878,6 +878,12 @@ SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized) |
|
|
Atom _NET_WM_STATE_MAXIMIZED_VERT = data->videodata->_NET_WM_STATE_MAXIMIZED_VERT; |
|
|
Atom _NET_WM_STATE_MAXIMIZED_HORZ = data->videodata->_NET_WM_STATE_MAXIMIZED_HORZ; |
|
|
|
|
|
if (maximized) { |
|
|
window->flags |= SDL_WINDOW_MAXIMIZED; |
|
|
} else { |
|
|
window->flags &= ~SDL_WINDOW_MAXIMIZED; |
|
|
} |
|
|
|
|
|
if (X11_IsWindowMapped(_this, window)) { |
|
|
XEvent e; |
|
|
|
|
@@ -895,15 +901,7 @@ SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized) |
|
|
XSendEvent(display, RootWindow(display, displaydata->screen), 0, |
|
|
SubstructureNotifyMask | SubstructureRedirectMask, &e); |
|
|
} else { |
|
|
Uint32 flags; |
|
|
|
|
|
flags = window->flags; |
|
|
if (maximized) { |
|
|
flags |= SDL_WINDOW_MAXIMIZED; |
|
|
} else { |
|
|
flags &= ~SDL_WINDOW_MAXIMIZED; |
|
|
} |
|
|
X11_SetNetWMState(_this, data->xwindow, flags); |
|
|
X11_SetNetWMState(_this, data->xwindow, window->flags); |
|
|
} |
|
|
XFlush(display); |
|
|
} |
|
|