Skip to content

Commit

Permalink
Re-set the maximize state if we were maximized while fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Oct 29, 2022
1 parent ab06a30 commit 4556074
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/video/x11/SDL_x11window.c
Expand Up @@ -1388,13 +1388,17 @@ X11_SetWindowFullscreenViaWM(_THIS, SDL_Window * window, SDL_VideoDisplay * _dis

/* Fullscreen windows sometimes end up being marked maximized by
window managers. Force it back to how we expect it to be. */
if (!fullscreen && ((window->flags & SDL_WINDOW_MAXIMIZED) == 0)) {
if (!fullscreen) {
SDL_zero(e);
e.xany.type = ClientMessage;
e.xclient.message_type = _NET_WM_STATE;
e.xclient.format = 32;
e.xclient.window = data->xwindow;
e.xclient.data.l[0] = _NET_WM_STATE_REMOVE;
if ((window->flags & SDL_WINDOW_MAXIMIZED) != 0) {
e.xclient.data.l[0] = _NET_WM_STATE_ADD;
} else {
e.xclient.data.l[0] = _NET_WM_STATE_REMOVE;
}
e.xclient.data.l[1] = data->videodata->_NET_WM_STATE_MAXIMIZED_VERT;
e.xclient.data.l[2] = data->videodata->_NET_WM_STATE_MAXIMIZED_HORZ;
e.xclient.data.l[3] = 0l;
Expand Down

0 comments on commit 4556074

Please sign in to comment.