From 6db0f6f80f75f7e141e3a8b0c19fa317354bf5cc Mon Sep 17 00:00:00 2001 From: "S. Christoffer Eliesen" Date: Sun, 20 Dec 2015 12:42:10 +0100 Subject: [PATCH] extensions: panel_config->resource => wl_surface_res. Change the name to something less ambigious. --- include/extensions.h | 6 ++++-- sway/extensions.c | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/extensions.h b/include/extensions.h index 311ead1de..67c7d5fe5 100644 --- a/include/extensions.h +++ b/include/extensions.h @@ -9,13 +9,15 @@ struct background_config { wlc_handle output; wlc_resource surface; - struct wl_resource *resource; + // we need the wl_resource of the surface in the destructor + struct wl_resource *wl_surface_res; }; struct panel_config { wlc_handle output; wlc_resource surface; - struct wl_resource *resource; + // we need the wl_resource of the surface in the destructor + struct wl_resource *wl_surface_res; }; struct desktop_shell_state { diff --git a/sway/extensions.c b/sway/extensions.c index 5e09bdbb0..d37eadddb 100644 --- a/sway/extensions.c +++ b/sway/extensions.c @@ -14,7 +14,7 @@ void background_surface_destructor(struct wl_resource *resource) { int i; for (i = 0; i < desktop_shell.backgrounds->length; ++i) { struct background_config *config = desktop_shell.backgrounds->items[i]; - if (config->resource == resource) { + if (config->wl_surface_res == resource) { list_del(desktop_shell.backgrounds, i); break; } @@ -26,7 +26,7 @@ void panel_surface_destructor(struct wl_resource *resource) { int i; for (i = 0; i < desktop_shell.panels->length; ++i) { struct panel_config *config = desktop_shell.panels->items[i]; - if (config->resource == resource) { + if (config->wl_surface_res == resource) { list_del(desktop_shell.panels, i); arrange_windows(&root_container, -1, -1); break; @@ -58,7 +58,7 @@ static void set_background(struct wl_client *client, struct wl_resource *resourc struct background_config *config = malloc(sizeof(struct background_config)); config->output = output; config->surface = wlc_resource_from_wl_surface_resource(surface); - config->resource = surface; + config->wl_surface_res = surface; list_add(desktop_shell.backgrounds, config); wl_resource_set_destructor(surface, background_surface_destructor); } @@ -73,7 +73,7 @@ static void set_panel(struct wl_client *client, struct wl_resource *resource, struct panel_config *config = malloc(sizeof(struct panel_config)); config->output = output; config->surface = wlc_resource_from_wl_surface_resource(surface); - config->resource = surface; + config->wl_surface_res = surface; list_add(desktop_shell.panels, config); wl_resource_set_destructor(surface, panel_surface_destructor); desktop_shell.panel_size = *wlc_surface_get_size(config->surface);