|
|
@ -14,7 +14,7 @@ void background_surface_destructor(struct wl_resource *resource) {
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < desktop_shell.backgrounds->length; ++i) {
|
|
|
|
for (i = 0; i < desktop_shell.backgrounds->length; ++i) {
|
|
|
|
struct background_config *config = desktop_shell.backgrounds->items[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);
|
|
|
|
list_del(desktop_shell.backgrounds, i);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -26,7 +26,7 @@ void panel_surface_destructor(struct wl_resource *resource) {
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < desktop_shell.panels->length; ++i) {
|
|
|
|
for (i = 0; i < desktop_shell.panels->length; ++i) {
|
|
|
|
struct panel_config *config = desktop_shell.panels->items[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);
|
|
|
|
list_del(desktop_shell.panels, i);
|
|
|
|
arrange_windows(&root_container, -1, -1);
|
|
|
|
arrange_windows(&root_container, -1, -1);
|
|
|
|
break;
|
|
|
|
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));
|
|
|
|
struct background_config *config = malloc(sizeof(struct background_config));
|
|
|
|
config->output = output;
|
|
|
|
config->output = output;
|
|
|
|
config->surface = wlc_resource_from_wl_surface_resource(surface);
|
|
|
|
config->surface = wlc_resource_from_wl_surface_resource(surface);
|
|
|
|
config->resource = surface;
|
|
|
|
config->wl_surface_res = surface;
|
|
|
|
list_add(desktop_shell.backgrounds, config);
|
|
|
|
list_add(desktop_shell.backgrounds, config);
|
|
|
|
wl_resource_set_destructor(surface, background_surface_destructor);
|
|
|
|
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));
|
|
|
|
struct panel_config *config = malloc(sizeof(struct panel_config));
|
|
|
|
config->output = output;
|
|
|
|
config->output = output;
|
|
|
|
config->surface = wlc_resource_from_wl_surface_resource(surface);
|
|
|
|
config->surface = wlc_resource_from_wl_surface_resource(surface);
|
|
|
|
config->resource = surface;
|
|
|
|
config->wl_surface_res = surface;
|
|
|
|
list_add(desktop_shell.panels, config);
|
|
|
|
list_add(desktop_shell.panels, config);
|
|
|
|
wl_resource_set_destructor(surface, panel_surface_destructor);
|
|
|
|
wl_resource_set_destructor(surface, panel_surface_destructor);
|
|
|
|
desktop_shell.panel_size = *wlc_surface_get_size(config->surface);
|
|
|
|
desktop_shell.panel_size = *wlc_surface_get_size(config->surface);
|
|
|
|