From e960b3f012f8547f60dc74783cac585d9fa47323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 5 Dec 2013 22:04:42 -0800 Subject: [PATCH] desktop-shell: Set fullscreen flags in common code path Just as for set_maximized() we can move the setting of the fullscreen and state_changed flags into the common set_fullscreen() function. This function is also used from the xwayland wm to set fullscreen windows, and with this change that now works again. --- desktop-shell/shell.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index a8279805..3a1981d2 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -2184,6 +2184,8 @@ set_fullscreen(struct shell_surface *shsurf, shsurf->fullscreen.type = method; shsurf->fullscreen.framerate = framerate; + shsurf->next_state.fullscreen = true; + shsurf->state_changed = true; shsurf->next_type = SHELL_SURFACE_TOPLEVEL; shsurf->client->send_configure(shsurf->surface, 0, @@ -2243,8 +2245,6 @@ shell_surface_set_fullscreen(struct wl_client *client, shell_surface_set_parent(shsurf, NULL); surface_clear_next_states(shsurf); - shsurf->next_state.fullscreen = true; - shsurf->state_changed = true; set_fullscreen(shsurf, method, framerate, output); } @@ -3122,13 +3122,10 @@ xdg_surface_set_fullscreen(struct wl_client *client, if (shsurf->type != SHELL_SURFACE_TOPLEVEL) return; - if (!shsurf->next_state.fullscreen) { - shsurf->next_state.fullscreen = true; - shsurf->state_changed = true; + if (!shsurf->next_state.fullscreen) set_fullscreen(shsurf, WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, shsurf->recommended_output); - } } static void