Merge pull request #390 from emersion/rootston-maximize

Maximize views in rootston
This commit is contained in:
Drew DeVault 2017-11-10 08:26:20 -05:00 committed by GitHub
commit e6babc07a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 220 additions and 47 deletions

View file

@ -171,7 +171,6 @@ static void shell_surface_destroy_popup_state(
}
}
static void shell_surface_protocol_resize(struct wl_client *client,
struct wl_resource *resource, struct wl_resource *seat_resource,
uint32_t serial, enum wl_shell_surface_resize edges) {
@ -287,9 +286,8 @@ static void shell_surface_protocol_set_fullscreen(struct wl_client *client,
output = wl_resource_get_user_data(output_resource);
}
if (surface->state == WLR_WL_SHELL_SURFACE_STATE_TOPLEVEL) {
return;
}
shell_surface_set_state(surface, WLR_WL_SHELL_SURFACE_STATE_FULLSCREEN,
NULL, NULL);
struct wlr_wl_shell_surface_set_fullscreen_event *event =
calloc(1, sizeof(struct wlr_wl_shell_surface_set_fullscreen_event));
@ -377,9 +375,8 @@ static void shell_surface_protocol_set_maximized(struct wl_client *client,
output = wl_resource_get_user_data(output_resource);
}
if (surface->state == WLR_WL_SHELL_SURFACE_STATE_TOPLEVEL) {
return;
}
shell_surface_set_state(surface, WLR_WL_SHELL_SURFACE_STATE_MAXIMIZED,
NULL, NULL);
struct wlr_wl_shell_surface_set_maximized_event *event =
calloc(1, sizeof(struct wlr_wl_shell_surface_set_maximized_event));

View file

@ -664,24 +664,28 @@ static void xdg_toplevel_protocol_set_maximized(struct wl_client *client,
struct wl_resource *resource) {
struct wlr_xdg_surface_v6 *surface = wl_resource_get_user_data(resource);
surface->toplevel_state->next.maximized = true;
wl_signal_emit(&surface->events.request_maximize, surface);
}
static void xdg_toplevel_protocol_unset_maximized(struct wl_client *client,
struct wl_resource *resource) {
struct wlr_xdg_surface_v6 *surface = wl_resource_get_user_data(resource);
surface->toplevel_state->next.maximized = false;
wl_signal_emit(&surface->events.request_maximize, surface);
}
static void xdg_toplevel_protocol_set_fullscreen(struct wl_client *client,
struct wl_resource *resource, struct wl_resource *output_resource) {
struct wlr_xdg_surface_v6 *surface = wl_resource_get_user_data(resource);
surface->toplevel_state->next.fullscreen = true;
wl_signal_emit(&surface->events.request_fullscreen, surface);
}
static void xdg_toplevel_protocol_unset_fullscreen(struct wl_client *client,
struct wl_resource *resource) {
struct wlr_xdg_surface_v6 *surface = wl_resource_get_user_data(resource);
surface->toplevel_state->next.fullscreen = false;
wl_signal_emit(&surface->events.request_fullscreen, surface);
}
static void xdg_toplevel_protocol_set_minimized(struct wl_client *client,
@ -1143,6 +1147,8 @@ static void xdg_shell_get_xdg_surface(struct wl_client *wl_client,
wl_list_init(&surface->configure_list);
wl_list_init(&surface->popups);
wl_signal_init(&surface->events.request_maximize);
wl_signal_init(&surface->events.request_fullscreen);
wl_signal_init(&surface->events.request_minimize);
wl_signal_init(&surface->events.request_move);
wl_signal_init(&surface->events.request_resize);