Fix fullscreen toggle when dynamic session resize is disabled

When dynamic session resize is disabled, leaving fullscreen should
result in a window that matches the session size.

Co-authored-by: Henrik Andersson <hean01@cendio.com>
Co-authored-by: Karl Mikaelsson <derfian@cendio.se>
This commit is contained in:
Cendio 2018-02-13 16:19:54 +01:00
parent 8bc2cea80f
commit a0af72a337

17
xwin.c
View File

@ -2359,11 +2359,22 @@ xwin_toggle_fullscreen(void)
} }
else else
{ {
/* Restore "old" window size */ /* Switch from fullscreen to window mode */
x = windowed_x; x = windowed_x;
y = windowed_y; y = windowed_y;
width = windowed_width;
height = windowed_height; if (g_dynamic_session_resize)
{
/* Restore "old" window size, resize session to fit */
width = windowed_width;
height = windowed_height;
}
else
{
/* Resize window to fit session size */
width = g_session_width;
height = g_session_height;
}
} }
logger(GUI, Debug, "xwin_toggle_fullscreen(), new window: %dx%d+%d+%d, last window: %dx%d", logger(GUI, Debug, "xwin_toggle_fullscreen(), new window: %dx%d+%d+%d, last window: %dx%d",