From 91bf9b4d14bcf135809a7fd381ebaf7986042f47 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Mon, 16 Apr 2018 17:53:11 +0900 Subject: wayland renderer: implement bottom --- lib/renderers/wayland/wayland.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/renderers/wayland/wayland.c') diff --git a/lib/renderers/wayland/wayland.c b/lib/renderers/wayland/wayland.c index ab32a3e..cebba45 100644 --- a/lib/renderers/wayland/wayland.c +++ b/lib/renderers/wayland/wayland.c @@ -177,6 +177,18 @@ get_displayed_count(const struct bm_menu *menu) return max; } +static void +set_bottom(const struct bm_menu *menu, bool bottom) +{ + struct wayland *wayland = menu->renderer->internal; + assert(wayland); + + struct window *window; + wl_list_for_each(window, &wayland->windows, link) { + bm_wl_window_set_bottom(window, wayland->display, bottom); + } +} + static void destructor(struct bm_menu *menu) { @@ -234,6 +246,7 @@ constructor(struct bm_menu *menu) if (!(surface = wl_compositor_create_surface(wayland->compositor))) goto fail; struct window *window = calloc(1, sizeof(struct window)); + window->bottom = menu->bottom; if (!bm_wl_window_create(window, wayland->display, wayland->shm, output->output, wayland->layer_shell, surface)) goto fail; window->notify.render = bm_cairo_paint; @@ -268,6 +281,7 @@ register_renderer(struct render_api *api) api->get_displayed_count = get_displayed_count; api->poll_key = poll_key; api->render = render; + api->set_bottom = set_bottom; api->priorty = BM_PRIO_GUI; api->version = BM_PLUGIN_VERSION; return "wayland"; -- cgit v1.2.3-70-g09d2 From 86f6e57bfe46e4a06177ed673410288f2330d1cc Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Mon, 16 Apr 2018 17:53:42 +0900 Subject: wayland renderer: fix indentation --- lib/renderers/wayland/wayland.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lib/renderers/wayland/wayland.c') diff --git a/lib/renderers/wayland/wayland.c b/lib/renderers/wayland/wayland.c index cebba45..69ca230 100644 --- a/lib/renderers/wayland/wayland.c +++ b/lib/renderers/wayland/wayland.c @@ -242,16 +242,16 @@ constructor(struct bm_menu *menu) struct output *output; wl_list_for_each(output, &wayland->outputs, link) { - struct wl_surface *surface; - if (!(surface = wl_compositor_create_surface(wayland->compositor))) - goto fail; - struct window *window = calloc(1, sizeof(struct window)); - window->bottom = menu->bottom; - if (!bm_wl_window_create(window, wayland->display, wayland->shm, output->output, wayland->layer_shell, surface)) - goto fail; - window->notify.render = bm_cairo_paint; - window->max_height = output->height; - wl_list_insert(&wayland->windows, &window->link); + struct wl_surface *surface; + if (!(surface = wl_compositor_create_surface(wayland->compositor))) + goto fail; + struct window *window = calloc(1, sizeof(struct window)); + window->bottom = menu->bottom; + if (!bm_wl_window_create(window, wayland->display, wayland->shm, output->output, wayland->layer_shell, surface)) + goto fail; + window->notify.render = bm_cairo_paint; + window->max_height = output->height; + wl_list_insert(&wayland->windows, &window->link); } if (!efd && (efd = epoll_create(EPOLL_CLOEXEC)) < 0) -- cgit v1.2.3-70-g09d2