diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-19 20:24:16 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-03-27 18:50:09 -0400 |
commit | fcf8c6c8a29e3ce0a17bcf7ce1ca92fed8493502 (patch) | |
tree | 69b00e207f85533f6af1ddf286ffe222d5aec43f /examples | |
parent | 4bc1cc49d5b8007145774214bc9126577b56b53c (diff) |
Fix issues preventing layer from getting allocated
Now all of the steps to get rootston a reference to the layer surface
are correctly wired up.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/layer-shell.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/layer-shell.c b/examples/layer-shell.c index 9b26386d..d2e07a90 100644 --- a/examples/layer-shell.c +++ b/examples/layer-shell.c @@ -21,7 +21,7 @@ struct wlr_egl_surface *egl_surface; struct wl_callback *frame_callback; static uint32_t output = 0; -static uint32_t layer = -1; +static uint32_t layer = ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; static uint32_t anchor = 0; static uint32_t width = 256, height = 256; @@ -98,7 +98,7 @@ int main(int argc, char **argv) { char *namespace = "wlroots"; bool found; int c; - while ((c = getopt(argc, argv, "w:h:o:"))) { + while ((c = getopt(argc, argv, "w:h:o:")) != -1) { switch (c) { case 'o': output = atoi(optarg); @@ -185,9 +185,6 @@ int main(int argc, char **argv) { return 1; } - wlr_egl_init(&egl, EGL_PLATFORM_WAYLAND_EXT, display, NULL, - WL_SHM_FORMAT_ARGB8888); - wl_surface = wl_compositor_create_surface(compositor); struct zwlr_layer_surface_v1 *layer_surface = @@ -195,8 +192,12 @@ int main(int argc, char **argv) { wl_surface, wl_output, layer, namespace); zwlr_layer_surface_v1_set_anchor(layer_surface, anchor); // TODO: margin, interactivity, exclusive zone - wl_surface_commit(wl_surface); + wl_display_dispatch(display); + wl_display_roundtrip(display); + + wlr_egl_init(&egl, EGL_PLATFORM_WAYLAND_EXT, display, NULL, + WL_SHM_FORMAT_ARGB8888); egl_window = wl_egl_window_create(wl_surface, width, height); egl_surface = wlr_egl_create_surface(&egl, egl_window); |