From 3e5131e664c605f406756bae51d1276a67b5fa38 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 27 Mar 2018 21:25:40 -0400 Subject: [PATCH] Address further review feedback --- rootston/desktop.c | 14 +++++++------- rootston/layer_shell.c | 9 +++++---- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/rootston/desktop.c b/rootston/desktop.c index 9ea392f6..15e0e336 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -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); } diff --git a/rootston/layer_shell.c b/rootston/layer_shell.c index d6428c51..06ab15c3 100644 --- a/rootston/layer_shell.c +++ b/rootston/layer_shell.c @@ -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);