diff options
author | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-12-20 12:42:10 +0100 |
---|---|---|
committer | S. Christoffer Eliesen <christoffer@eliesen.no> | 2015-12-20 12:54:34 +0100 |
commit | 6db0f6f80f75f7e141e3a8b0c19fa317354bf5cc (patch) | |
tree | bc08973770f5ad6b3281db9c33c60668fa3da03b | |
parent | Merge pull request #366 from mikkeloscar/fix-swaybar-high-cpu (diff) | |
download | sway-6db0f6f80f75f7e141e3a8b0c19fa317354bf5cc.tar.gz sway-6db0f6f80f75f7e141e3a8b0c19fa317354bf5cc.tar.zst sway-6db0f6f80f75f7e141e3a8b0c19fa317354bf5cc.zip |
extensions: panel_config->resource => wl_surface_res.
Change the name to something less ambigious.
-rw-r--r-- | include/extensions.h | 6 | ||||
-rw-r--r-- | sway/extensions.c | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/include/extensions.h b/include/extensions.h index 311ead1d..67c7d5fe 100644 --- a/include/extensions.h +++ b/include/extensions.h | |||
@@ -9,13 +9,15 @@ | |||
9 | struct background_config { | 9 | struct background_config { |
10 | wlc_handle output; | 10 | wlc_handle output; |
11 | wlc_resource surface; | 11 | wlc_resource surface; |
12 | struct wl_resource *resource; | 12 | // we need the wl_resource of the surface in the destructor |
13 | struct wl_resource *wl_surface_res; | ||
13 | }; | 14 | }; |
14 | 15 | ||
15 | struct panel_config { | 16 | struct panel_config { |
16 | wlc_handle output; | 17 | wlc_handle output; |
17 | wlc_resource surface; | 18 | wlc_resource surface; |
18 | struct wl_resource *resource; | 19 | // we need the wl_resource of the surface in the destructor |
20 | struct wl_resource *wl_surface_res; | ||
19 | }; | 21 | }; |
20 | 22 | ||
21 | struct desktop_shell_state { | 23 | struct desktop_shell_state { |
diff --git a/sway/extensions.c b/sway/extensions.c index 5e09bdbb..d37eaddd 100644 --- a/sway/extensions.c +++ b/sway/extensions.c | |||
@@ -14,7 +14,7 @@ void background_surface_destructor(struct wl_resource *resource) { | |||
14 | int i; | 14 | int i; |
15 | for (i = 0; i < desktop_shell.backgrounds->length; ++i) { | 15 | for (i = 0; i < desktop_shell.backgrounds->length; ++i) { |
16 | struct background_config *config = desktop_shell.backgrounds->items[i]; | 16 | struct background_config *config = desktop_shell.backgrounds->items[i]; |
17 | if (config->resource == resource) { | 17 | if (config->wl_surface_res == resource) { |
18 | list_del(desktop_shell.backgrounds, i); | 18 | list_del(desktop_shell.backgrounds, i); |
19 | break; | 19 | break; |
20 | } | 20 | } |
@@ -26,7 +26,7 @@ void panel_surface_destructor(struct wl_resource *resource) { | |||
26 | int i; | 26 | int i; |
27 | for (i = 0; i < desktop_shell.panels->length; ++i) { | 27 | for (i = 0; i < desktop_shell.panels->length; ++i) { |
28 | struct panel_config *config = desktop_shell.panels->items[i]; | 28 | struct panel_config *config = desktop_shell.panels->items[i]; |
29 | if (config->resource == resource) { | 29 | if (config->wl_surface_res == resource) { |
30 | list_del(desktop_shell.panels, i); | 30 | list_del(desktop_shell.panels, i); |
31 | arrange_windows(&root_container, -1, -1); | 31 | arrange_windows(&root_container, -1, -1); |
32 | break; | 32 | break; |
@@ -58,7 +58,7 @@ static void set_background(struct wl_client *client, struct wl_resource *resourc | |||
58 | struct background_config *config = malloc(sizeof(struct background_config)); | 58 | struct background_config *config = malloc(sizeof(struct background_config)); |
59 | config->output = output; | 59 | config->output = output; |
60 | config->surface = wlc_resource_from_wl_surface_resource(surface); | 60 | config->surface = wlc_resource_from_wl_surface_resource(surface); |
61 | config->resource = surface; | 61 | config->wl_surface_res = surface; |
62 | list_add(desktop_shell.backgrounds, config); | 62 | list_add(desktop_shell.backgrounds, config); |
63 | wl_resource_set_destructor(surface, background_surface_destructor); | 63 | wl_resource_set_destructor(surface, background_surface_destructor); |
64 | } | 64 | } |
@@ -73,7 +73,7 @@ static void set_panel(struct wl_client *client, struct wl_resource *resource, | |||
73 | struct panel_config *config = malloc(sizeof(struct panel_config)); | 73 | struct panel_config *config = malloc(sizeof(struct panel_config)); |
74 | config->output = output; | 74 | config->output = output; |
75 | config->surface = wlc_resource_from_wl_surface_resource(surface); | 75 | config->surface = wlc_resource_from_wl_surface_resource(surface); |
76 | config->resource = surface; | 76 | config->wl_surface_res = surface; |
77 | list_add(desktop_shell.panels, config); | 77 | list_add(desktop_shell.panels, config); |
78 | wl_resource_set_destructor(surface, panel_surface_destructor); | 78 | wl_resource_set_destructor(surface, panel_surface_destructor); |
79 | desktop_shell.panel_size = *wlc_surface_get_size(config->surface); | 79 | desktop_shell.panel_size = *wlc_surface_get_size(config->surface); |