aboutsummaryrefslogtreecommitdiffstats
path: root/sway/extensions.c
diff options
context:
space:
mode:
authorLibravatar David Eklov <david.eklov@gmail.com>2016-07-04 16:53:03 -0500
committerLibravatar David Eklov <david.eklov@gmail.com>2016-07-04 21:58:07 -0500
commit51204b33c18b6f7c248f558fbaeb7198efb32900 (patch)
treefbbad0ad87bf91d3d8ca3f39cc22b23ed317e4d3 /sway/extensions.c
parentI think this fixes #678 (diff)
downloadsway-51204b33c18b6f7c248f558fbaeb7198efb32900.tar.gz
sway-51204b33c18b6f7c248f558fbaeb7198efb32900.tar.zst
sway-51204b33c18b6f7c248f558fbaeb7198efb32900.zip
Enable backgrounds and panels to be shell surfaces
Prior to this commit all windows (e.g. shell surfaces) were handled the same way in handle_view_created. Since backgrounds and panels have to be treated differently, they could not be shell surfaces. This changes checks whether a client is a background or a panel in handle_view_created and exists to let them be dealt with elsewhere.
Diffstat (limited to 'sway/extensions.c')
-rw-r--r--sway/extensions.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sway/extensions.c b/sway/extensions.c
index 7bc9bbe4..1fe15ac5 100644
--- a/sway/extensions.c
+++ b/sway/extensions.c
@@ -73,6 +73,7 @@ static void set_background(struct wl_client *client, struct wl_resource *resourc
73 } 73 }
74 sway_log(L_DEBUG, "Setting surface %p as background for output %d", surface, (int)output); 74 sway_log(L_DEBUG, "Setting surface %p as background for output %d", surface, (int)output);
75 struct background_config *config = malloc(sizeof(struct background_config)); 75 struct background_config *config = malloc(sizeof(struct background_config));
76 config->client = client;
76 config->output = output; 77 config->output = output;
77 config->surface = wlc_resource_from_wl_surface_resource(surface); 78 config->surface = wlc_resource_from_wl_surface_resource(surface);
78 config->wl_surface_res = surface; 79 config->wl_surface_res = surface;
@@ -91,6 +92,7 @@ static void set_panel(struct wl_client *client, struct wl_resource *resource,
91 sway_log(L_DEBUG, "Setting surface %p as panel for output %d (wl_resource: %p)", surface, (int)output, resource); 92 sway_log(L_DEBUG, "Setting surface %p as panel for output %d (wl_resource: %p)", surface, (int)output, resource);
92 struct panel_config *config = find_or_create_panel_config(resource); 93 struct panel_config *config = find_or_create_panel_config(resource);
93 config->output = output; 94 config->output = output;
95 config->client = client;
94 config->surface = wlc_resource_from_wl_surface_resource(surface); 96 config->surface = wlc_resource_from_wl_surface_resource(surface);
95 config->wl_surface_res = surface; 97 config->wl_surface_res = surface;
96 wl_resource_set_destructor(surface, panel_surface_destructor); 98 wl_resource_set_destructor(surface, panel_surface_destructor);