diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2012-10-01 17:45:46 +0200 |
---|---|---|
committer | David Herrmann <dh.herrmann@googlemail.com> | 2012-10-01 17:45:46 +0200 |
commit | 4679bde07e3810b03a817b6a25872adc075f4d41 (patch) | |
tree | 7ec0925fc8893e243e1eff7bc0c10036794fe685 /src/wlt_toolkit.c | |
parent | 911ae1af88380865bac7b1505d868f0d7dbbe787 (diff) |
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 <dh.herrmann@googlemail.com>
Diffstat (limited to 'src/wlt_toolkit.c')
-rw-r--r-- | src/wlt_toolkit.c | 20 |
1 files 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; |