Always set the size hints for consistent behavior with all window managers, and it wasn't resetting when switching back from fullscreen mode.
This commit is contained in:
parent
8577652dea
commit
b19b82aa44
1 changed files with 17 additions and 19 deletions
|
@ -917,28 +917,26 @@ X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _dis
|
||||||
if (X11_IsWindowMapped(_this, window)) {
|
if (X11_IsWindowMapped(_this, window)) {
|
||||||
XEvent e;
|
XEvent e;
|
||||||
|
|
||||||
if (!X11_IsActionAllowed(window, _NET_WM_ACTION_FULLSCREEN)) {
|
if (!(window->flags & SDL_WINDOW_RESIZABLE)) {
|
||||||
/* We aren't allowed to go into fullscreen mode... */
|
/* Compiz refuses fullscreen toggle if we're not resizable, so update the hints so we
|
||||||
if ((window->flags & SDL_WINDOW_RESIZABLE) == 0) {
|
can be resized to the fullscreen resolution (or reset so we're not resizable again) */
|
||||||
/* ...and we aren't resizable. Compiz refuses fullscreen toggle in this case. */
|
XSizeHints *sizehints = XAllocSizeHints();
|
||||||
XSizeHints *sizehints = XAllocSizeHints();
|
long flags = 0;
|
||||||
long flags = 0;
|
XGetWMNormalHints(display, data->xwindow, sizehints, &flags);
|
||||||
XGetWMNormalHints(display, data->xwindow, sizehints, &flags);
|
/* set the resize flags on */
|
||||||
/* set the resize flags on */
|
if (fullscreen) {
|
||||||
|
/* we are going fullscreen so turn the flags off */
|
||||||
|
sizehints->flags &= ~(PMinSize | PMaxSize);
|
||||||
|
} else {
|
||||||
|
/* Reset the min/max width height to make the window non-resizable again */
|
||||||
sizehints->flags |= PMinSize | PMaxSize;
|
sizehints->flags |= PMinSize | PMaxSize;
|
||||||
if (fullscreen) {
|
sizehints->min_width = sizehints->max_width = window->w;
|
||||||
/* we are going fullscreen so turn the flags off */
|
sizehints->min_height = sizehints->max_height = window->h;
|
||||||
sizehints->flags ^= (PMinSize | PMaxSize);
|
|
||||||
} else {
|
|
||||||
/* Reset the min/max width height to make the window non-resizable again */
|
|
||||||
sizehints->min_width = sizehints->max_width = window->w;
|
|
||||||
sizehints->min_height = sizehints->max_height = window->h;
|
|
||||||
}
|
|
||||||
XSetWMNormalHints(display, data->xwindow, sizehints);
|
|
||||||
XFree(sizehints);
|
|
||||||
}
|
}
|
||||||
|
XSetWMNormalHints(display, data->xwindow, sizehints);
|
||||||
|
XFree(sizehints);
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_zero(e);
|
SDL_zero(e);
|
||||||
e.xany.type = ClientMessage;
|
e.xany.type = ClientMessage;
|
||||||
e.xclient.message_type = _NET_WM_STATE;
|
e.xclient.message_type = _NET_WM_STATE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue