Skip to content

Commit

Permalink
Fix scaling artefacts
Browse files Browse the repository at this point in the history
Reuse the existing wl output instead of creating new one.

Resolves #89.

Signed-off-by: Artem Senichev <[email protected]>
  • Loading branch information
artemsen committed Jul 26, 2023
1 parent 0156ab1 commit d47d14a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d47d14a

Please sign in to comment.