shell: Don't use the helper methods in xdg_shell implementations

With most of the code in send_configure_for_surface, the helper
methods don't give us that much benefit, so stop using them. We
can't kill them off, as they're part of the shell interface and
used by the WM.
dev
Jasper St. Pierre 11 years ago committed by Kristian Høgsberg
parent 6458ec3410
commit 9aa8ce6985
  1. 45
      desktop-shell/shell.c

@ -157,7 +157,6 @@ struct shell_surface {
struct weston_output *fullscreen_output; struct weston_output *fullscreen_output;
struct weston_output *output; struct weston_output *output;
struct weston_output *recommended_output;
struct wl_list link; struct wl_list link;
const struct weston_shell_client *client; const struct weston_shell_client *client;
@ -2482,16 +2481,6 @@ shell_surface_set_popup(struct wl_client *client,
serial, x, y); serial, x, y);
} }
static void
set_maximized(struct shell_surface *shsurf,
struct weston_output *output)
{
shell_surface_set_output(shsurf, output);
shsurf->type = SHELL_SURFACE_TOPLEVEL;
send_configure_for_surface(shsurf);
}
static void static void
unset_maximized(struct shell_surface *shsurf) unset_maximized(struct shell_surface *shsurf)
{ {
@ -2568,18 +2557,21 @@ shell_surface_set_maximized(struct wl_client *client,
struct shell_surface *shsurf = wl_resource_get_user_data(resource); struct shell_surface *shsurf = wl_resource_get_user_data(resource);
struct weston_output *output; struct weston_output *output;
surface_clear_next_states(shsurf);
shsurf->next_state.maximized = true;
shsurf->state_changed = true;
shsurf->type = SHELL_SURFACE_TOPLEVEL;
shell_surface_set_parent(shsurf, NULL);
if (output_resource) if (output_resource)
output = wl_resource_get_user_data(output_resource); output = wl_resource_get_user_data(output_resource);
else else
output = NULL; output = NULL;
shell_surface_set_parent(shsurf, NULL); shell_surface_set_output(shsurf, output);
surface_clear_next_states(shsurf);
set_maximized(shsurf, output);
shsurf->next_state.maximized = true; send_configure_for_surface(shsurf);
shsurf->state_changed = true;
} }
/* This is only ever called from set_surface_type(), so there’s no need to /* This is only ever called from set_surface_type(), so there’s no need to
@ -3280,6 +3272,8 @@ create_common_surface(struct shell_client *owner, void *shell,
shsurf->fullscreen.black_view = NULL; shsurf->fullscreen.black_view = NULL;
wl_list_init(&shsurf->fullscreen.transform.link); wl_list_init(&shsurf->fullscreen.transform.link);
shsurf->output = get_default_output(shsurf->shell->compositor);
wl_signal_init(&shsurf->destroy_signal); wl_signal_init(&shsurf->destroy_signal);
shsurf->surface_destroy_listener.notify = shell_handle_surface_destroy; shsurf->surface_destroy_listener.notify = shell_handle_surface_destroy;
wl_signal_add(&surface->destroy_signal, wl_signal_add(&surface->destroy_signal,
@ -3466,7 +3460,7 @@ xdg_surface_set_maximized(struct wl_client *client,
shsurf->state_requested = true; shsurf->state_requested = true;
shsurf->requested_state.maximized = true; shsurf->requested_state.maximized = true;
set_maximized(shsurf, NULL); send_configure_for_surface(shsurf);
} }
static void static void
@ -3496,11 +3490,10 @@ xdg_surface_set_fullscreen(struct wl_client *client,
else else
output = NULL; output = NULL;
shsurf->recommended_output = output; shell_surface_set_output(shsurf, output);
shsurf->fullscreen_output = shsurf->output;
set_fullscreen(shsurf, send_configure_for_surface(shsurf);
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
0, shsurf->recommended_output);
} }
static void static void
@ -4162,8 +4155,7 @@ maximize_binding(struct weston_seat *seat, uint32_t time, uint32_t button, void
shsurf->state_requested = true; shsurf->state_requested = true;
shsurf->requested_state.maximized = !shsurf->state.maximized; shsurf->requested_state.maximized = !shsurf->state.maximized;
if (shsurf->requested_state.maximized) send_configure_for_surface(shsurf);
set_maximized(shsurf, NULL);
} }
static void static void
@ -4186,10 +4178,7 @@ fullscreen_binding(struct weston_seat *seat, uint32_t time, uint32_t button, voi
shsurf->state_requested = true; shsurf->state_requested = true;
shsurf->requested_state.fullscreen = !shsurf->state.fullscreen; shsurf->requested_state.fullscreen = !shsurf->state.fullscreen;
if (shsurf->requested_state.fullscreen) send_configure_for_surface(shsurf);
set_fullscreen(shsurf,
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
0, shsurf->recommended_output);
} }
static void static void

Loading…
Cancel
Save