From d47d14a0650232b0696b82665276fae127cbce55 Mon Sep 17 00:00:00 2001 From: Artem Senichev Date: Wed, 26 Jul 2023 12:37:46 +0300 Subject: [PATCH] Fix scaling artefacts Reuse the existing wl output instead of creating new one. Resolves #89. Signed-off-by: Artem Senichev --- src/ui.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ui.c b/src/ui.c index 6e0753c..d4e52b2 100644 --- a/src/ui.c +++ b/src/ui.c @@ -514,12 +514,11 @@ static void on_registry_global(void* data, struct wl_registry* registry, ctx->wl.compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 3); } else if (strcmp(interface, wl_output_interface.name) == 0) { - if (ctx->wl.output) { - wl_output_release(ctx->wl.output); + if (!ctx->wl.output) { + ctx->wl.output = + wl_registry_bind(registry, name, &wl_output_interface, 3); + wl_output_add_listener(ctx->wl.output, &wl_output_listener, data); } - ctx->wl.output = - wl_registry_bind(registry, name, &wl_output_interface, 3); - wl_output_add_listener(ctx->wl.output, &wl_output_listener, data); } else if (strcmp(interface, xdg_wm_base_interface.name) == 0) { ctx->xdg.base = wl_registry_bind(registry, name, &xdg_wm_base_interface, 1);