parent
a60814585d
commit
a99dfca578
3 changed files with 16 additions and 9 deletions
|
@ -1756,6 +1756,8 @@ SDL_MaximizeWindow(SDL_Window * window)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// !!! FIXME: should this check if the window is resizable?
|
||||||
|
|
||||||
if (_this->MaximizeWindow) {
|
if (_this->MaximizeWindow) {
|
||||||
_this->MaximizeWindow(_this, window);
|
_this->MaximizeWindow(_this, window);
|
||||||
}
|
}
|
||||||
|
|
|
@ -239,6 +239,13 @@ static __inline__ void ConvertNSRect(NSRect *r)
|
||||||
or resizing from a corner */
|
or resizing from a corner */
|
||||||
SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_MOVED, x, y);
|
SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_MOVED, x, y);
|
||||||
SDL_SendWindowEvent(_data->window, SDL_WINDOWEVENT_RESIZED, w, h);
|
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
|
- (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_VERT = data->videodata->_NET_WM_STATE_MAXIMIZED_VERT;
|
||||||
Atom _NET_WM_STATE_MAXIMIZED_HORZ = data->videodata->_NET_WM_STATE_MAXIMIZED_HORZ;
|
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)) {
|
if (X11_IsWindowMapped(_this, window)) {
|
||||||
XEvent e;
|
XEvent e;
|
||||||
|
|
||||||
|
@ -895,15 +901,7 @@ SetWindowMaximized(_THIS, SDL_Window * window, SDL_bool maximized)
|
||||||
XSendEvent(display, RootWindow(display, displaydata->screen), 0,
|
XSendEvent(display, RootWindow(display, displaydata->screen), 0,
|
||||||
SubstructureNotifyMask | SubstructureRedirectMask, &e);
|
SubstructureNotifyMask | SubstructureRedirectMask, &e);
|
||||||
} else {
|
} else {
|
||||||
Uint32 flags;
|
X11_SetNetWMState(_this, data->xwindow, window->flags);
|
||||||
|
|
||||||
flags = window->flags;
|
|
||||||
if (maximized) {
|
|
||||||
flags |= SDL_WINDOW_MAXIMIZED;
|
|
||||||
} else {
|
|
||||||
flags &= ~SDL_WINDOW_MAXIMIZED;
|
|
||||||
}
|
|
||||||
X11_SetNetWMState(_this, data->xwindow, flags);
|
|
||||||
}
|
}
|
||||||
XFlush(display);
|
XFlush(display);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue