aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--protocols/wlr-layer-shell-unstable-v1.xml6
-rw-r--r--swaybg/main.c13
2 files changed, 13 insertions, 6 deletions
diff --git a/protocols/wlr-layer-shell-unstable-v1.xml b/protocols/wlr-layer-shell-unstable-v1.xml
index 3181c0bb..6a5d5d35 100644
--- a/protocols/wlr-layer-shell-unstable-v1.xml
+++ b/protocols/wlr-layer-shell-unstable-v1.xml
@@ -47,12 +47,16 @@
47 or manipulate a buffer prior to the first layer_surface.configure call 47 or manipulate a buffer prior to the first layer_surface.configure call
48 must also be treated as errors. 48 must also be treated as errors.
49 49
50 You may pass NULL for output to allow the compositor to decide which
51 output to use. Generally this will be the one that the user most
52 recently interacted with.
53
50 Clients can specify a namespace that defines the purpose of the layer 54 Clients can specify a namespace that defines the purpose of the layer
51 surface. 55 surface.
52 </description> 56 </description>
53 <arg name="id" type="new_id" interface="zwlr_layer_surface_v1"/> 57 <arg name="id" type="new_id" interface="zwlr_layer_surface_v1"/>
54 <arg name="surface" type="object" interface="wl_surface"/> 58 <arg name="surface" type="object" interface="wl_surface"/>
55 <arg name="output" type="object" interface="wl_output"/> 59 <arg name="output" type="object" interface="wl_output" allow-null="true"/>
56 <arg name="layer" type="uint" enum="layer" summary="layer to add this surface to"/> 60 <arg name="layer" type="uint" enum="layer" summary="layer to add this surface to"/>
57 <arg name="namespace" type="string" summary="namespace for the layer surface"/> 61 <arg name="namespace" type="string" summary="namespace for the layer surface"/>
58 </request> 62 </request>
diff --git a/swaybg/main.c b/swaybg/main.c
index 679b8c20..5b6c378c 100644
--- a/swaybg/main.c
+++ b/swaybg/main.c
@@ -113,7 +113,7 @@ static void layer_surface_closed(void *data,
113 state->run_display = false; 113 state->run_display = false;
114} 114}
115 115
116struct zwlr_layer_surface_v1_listener layer_surface_listener = { 116static const struct zwlr_layer_surface_v1_listener layer_surface_listener = {
117 .configure = layer_surface_configure, 117 .configure = layer_surface_configure,
118 .closed = layer_surface_closed, 118 .closed = layer_surface_closed,
119}; 119};
@@ -141,7 +141,7 @@ static void output_scale(void *data, struct wl_output *output, int32_t factor) {
141 } 141 }
142} 142}
143 143
144struct wl_output_listener output_listener = { 144static const struct wl_output_listener output_listener = {
145 .geometry = output_geometry, 145 .geometry = output_geometry,
146 .mode = output_mode, 146 .mode = output_mode,
147 .done = output_done, 147 .done = output_done,
@@ -203,7 +203,8 @@ int main(int argc, const char **argv) {
203 return 1; 203 return 1;
204 } 204 }
205 205
206 assert(state.display = wl_display_connect(NULL)); 206 state.display = wl_display_connect(NULL);
207 assert(state.display);
207 208
208 struct wl_registry *registry = wl_display_get_registry(state.display); 209 struct wl_registry *registry = wl_display_get_registry(state.display);
209 wl_registry_add_listener(registry, &registry_listener, &state); 210 wl_registry_add_listener(registry, &registry_listener, &state);
@@ -213,9 +214,11 @@ int main(int argc, const char **argv) {
213 // Second roundtrip to get output properties 214 // Second roundtrip to get output properties
214 wl_display_roundtrip(state.display); 215 wl_display_roundtrip(state.display);
215 216
216 assert(state.surface = wl_compositor_create_surface(state.compositor)); 217 state.surface = wl_compositor_create_surface(state.compositor);
218 assert(state.surface);
217 219
218 assert(state.input_region = wl_compositor_create_region(state.compositor)); 220 state.input_region = wl_compositor_create_region(state.compositor);
221 assert(state.input_region);
219 wl_surface_set_input_region(state.surface, state.input_region); 222 wl_surface_set_input_region(state.surface, state.input_region);
220 223
221 state.layer_surface = zwlr_layer_shell_v1_get_layer_surface( 224 state.layer_surface = zwlr_layer_shell_v1_get_layer_surface(