From 4679bde07e3810b03a817b6a25872adc075f4d41 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Mon, 1 Oct 2012 17:45:46 +0200 Subject: [PATCH] wlt: toolkit: make fullscreen overwrite maximized mode If *_toggle_maximized() is called while in fullscreen, we still change our internal state, but we do not modify the application behavior in regard to wl_shell_surface state. Instead, we stay fullscreen until it is deactivated again. Signed-off-by: David Herrmann --- src/wlt_toolkit.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/wlt_toolkit.c b/src/wlt_toolkit.c index e9bd860..112dcd0 100644 --- a/src/wlt_toolkit.c +++ b/src/wlt_toolkit.c @@ -1509,14 +1509,18 @@ void wlt_window_toggle_maximize(struct wlt_window *wnd) return; if (wnd->maximized) { - wl_shell_surface_set_toplevel(wnd->w_shell_surface); - wlt_window_set_size(wnd, wnd->saved_width, wnd->saved_height); + if (!wnd->fullscreen) { + wl_shell_surface_set_toplevel(wnd->w_shell_surface); + wlt_window_set_size(wnd, wnd->saved_width, + wnd->saved_height); + } } else { if (!wnd->fullscreen) { wnd->saved_width = wnd->buffer.width; wnd->saved_height = wnd->buffer.height; + wl_shell_surface_set_maximized(wnd->w_shell_surface, + NULL); } - wl_shell_surface_set_maximized(wnd->w_shell_surface, NULL); } wnd->maximized = !wnd->maximized; @@ -1528,8 +1532,14 @@ void wlt_window_toggle_fullscreen(struct wlt_window *wnd) return; if (wnd->fullscreen) { - wl_shell_surface_set_toplevel(wnd->w_shell_surface); - wlt_window_set_size(wnd, wnd->saved_width, wnd->saved_height); + if (wnd->maximized) { + wl_shell_surface_set_maximized(wnd->w_shell_surface, + NULL); + } else { + wl_shell_surface_set_toplevel(wnd->w_shell_surface); + wlt_window_set_size(wnd, wnd->saved_width, + wnd->saved_height); + } } else { if (!wnd->maximized) { wnd->saved_width = wnd->buffer.width; -- 2.7.4