summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-04-11 16:18:54 -0700
committerKristian Høgsberg <krh@bitplanet.net>2014-05-12 23:34:05 -0700
commit9aa8ce69853863d69c0363662b90c918a0b9225a (patch)
tree10ba981ed02b805c9007651659ef1d157f714a8a
parent6458ec3410b5ce3daa3c3af9c4d19248817e244a (diff)
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.
-rw-r--r--desktop-shell/shell.c45
1 files changed, 17 insertions, 28 deletions
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 293697f3..591d8321 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -157,7 +157,6 @@ struct shell_surface {
struct weston_output *fullscreen_output;
struct weston_output *output;
- struct weston_output *recommended_output;
struct wl_list link;
const struct weston_shell_client *client;
@@ -2483,16 +2482,6 @@ shell_surface_set_popup(struct wl_client *client,
}
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
unset_maximized(struct shell_surface *shsurf)
{
/* undo all maximized things here */
@@ -2568,18 +2557,21 @@ shell_surface_set_maximized(struct wl_client *client,
struct shell_surface *shsurf = wl_resource_get_user_data(resource);
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)
output = wl_resource_get_user_data(output_resource);
else
output = NULL;
- shell_surface_set_parent(shsurf, NULL);
-
- surface_clear_next_states(shsurf);
- set_maximized(shsurf, output);
+ shell_surface_set_output(shsurf, output);
- shsurf->next_state.maximized = true;
- shsurf->state_changed = true;
+ send_configure_for_surface(shsurf);
}
/* 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;
wl_list_init(&shsurf->fullscreen.transform.link);
+ shsurf->output = get_default_output(shsurf->shell->compositor);
+
wl_signal_init(&shsurf->destroy_signal);
shsurf->surface_destroy_listener.notify = shell_handle_surface_destroy;
wl_signal_add(&surface->destroy_signal,
@@ -3466,7 +3460,7 @@ xdg_surface_set_maximized(struct wl_client *client,
shsurf->state_requested = true;
shsurf->requested_state.maximized = true;
- set_maximized(shsurf, NULL);
+ send_configure_for_surface(shsurf);
}
static void
@@ -3496,11 +3490,10 @@ xdg_surface_set_fullscreen(struct wl_client *client,
else
output = NULL;
- shsurf->recommended_output = output;
+ shell_surface_set_output(shsurf, output);
+ shsurf->fullscreen_output = shsurf->output;
- set_fullscreen(shsurf,
- WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
- 0, shsurf->recommended_output);
+ send_configure_for_surface(shsurf);
}
static void
@@ -4162,8 +4155,7 @@ maximize_binding(struct weston_seat *seat, uint32_t time, uint32_t button, void
shsurf->state_requested = true;
shsurf->requested_state.maximized = !shsurf->state.maximized;
- if (shsurf->requested_state.maximized)
- set_maximized(shsurf, NULL);
+ send_configure_for_surface(shsurf);
}
static void
@@ -4186,10 +4178,7 @@ fullscreen_binding(struct weston_seat *seat, uint32_t time, uint32_t button, voi
shsurf->state_requested = true;
shsurf->requested_state.fullscreen = !shsurf->state.fullscreen;
- if (shsurf->requested_state.fullscreen)
- set_fullscreen(shsurf,
- WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
- 0, shsurf->recommended_output);
+ send_configure_for_surface(shsurf);
}
static void