From fc69aa6e2bccca461a0bd0c10b448b64ccda1d42 Mon Sep 17 00:00:00 2001 From: adnano Date: Sat, 1 Mar 2025 07:04:00 -0500 Subject: Render menu after surface enter event This fixes an issue where the first visible frame is blurry on fractional scale displays. --- wayland.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'wayland.c') diff --git a/wayland.c b/wayland.c index 0d3f261..823ced1 100644 --- a/wayland.c +++ b/wayland.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -18,6 +17,7 @@ #include "menu.h" #include "pool-buffer.h" +#include "render.h" #include "wayland.h" #include "xdg-activation-v1-client-protocol.h" #include "wlr-layer-shell-unstable-v1-client-protocol.h" @@ -208,6 +208,7 @@ static void noop() { static void surface_enter(void *data, struct wl_surface *surface, struct wl_output *wl_output) { struct wl_context *context = data; context->output = wl_output_get_user_data(wl_output); + menu_invalidate(context->menu); } static const struct wl_surface_listener surface_listener = { @@ -492,6 +493,11 @@ int menu_run(struct menu *menu) { if (fds[1].revents & POLLIN) { keyboard_repeat(context->keyboard); } + + // Render the menu if necessary + if (!menu->rendered) { + render_menu(menu); + } } context_destroy(context); -- cgit v1.2.3