Address further review feedback

This commit is contained in:
Drew DeVault 2018-03-27 21:25:40 -04:00
parent a1d5d20914
commit 3e5131e664
2 changed files with 12 additions and 11 deletions

View File

@ -192,13 +192,6 @@ void view_arrange_maximized(struct roots_view *view) {
struct wlr_box view_box;
view_get_box(view, &view_box);
view->maximized = true;
view->saved.x = view->x;
view->saved.y = view->y;
view->saved.rotation = view->rotation;
view->saved.width = view_box.width;
view->saved.height = view_box.height;
struct wlr_output *output = view_get_output(view);
struct roots_output *roots_output = output->data;
struct wlr_box *output_box =
@ -224,6 +217,13 @@ void view_maximize(struct roots_view *view, bool maximized) {
}
if (!view->maximized && maximized) {
view->maximized = true;
view->saved.x = view->x;
view->saved.y = view->y;
view->saved.rotation = view->rotation;
view->saved.width = view->width;
view->saved.height = view->height;
view_arrange_maximized(view);
}

View File

@ -239,10 +239,6 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) {
static void unmap(struct wlr_layer_surface *layer_surface) {
struct roots_layer_surface *layer = layer_surface->data;
if (layer->link.prev) {
wl_list_remove(&layer->link);
}
struct wlr_output *wlr_output = layer_surface->output;
if (wlr_output != NULL) {
struct roots_output *output = wlr_output->data;
@ -256,6 +252,11 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
if (layer->layer_surface->mapped) {
unmap(layer->layer_surface);
}
wl_list_remove(&layer->link);
wl_list_remove(&layer->destroy.link);
wl_list_remove(&layer->map.link);
wl_list_remove(&layer->unmap.link);
wl_list_remove(&layer->surface_commit.link);
wl_list_remove(&layer->output_destroy.link);
wl_list_remove(&layer->output_mode.link);
wl_list_remove(&layer->output_transform.link);