aboutsummaryrefslogtreecommitdiff
path: root/wayland.c
diff options
context:
space:
mode:
authoradnano <me@adnano.co>2025-03-01 07:04:00 -0500
committeradnano <me@adnano.co>2025-03-01 07:04:00 -0500
commitfc69aa6e2bccca461a0bd0c10b448b64ccda1d42 (patch)
tree98b05a54f9d150690702f224b79a651fa3660752 /wayland.c
parenteec775fad7f7b090e6de2dbfe0c242129fddba41 (diff)
downloadwmenu-fc69aa6e2bccca461a0bd0c10b448b64ccda1d42.tar.gz
Render menu after surface enter event
This fixes an issue where the first visible frame is blurry on fractional scale displays.
Diffstat (limited to 'wayland.c')
-rw-r--r--wayland.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/wayland.c b/wayland.c
index 0d3f261..823ced1 100644
--- a/wayland.c
+++ b/wayland.c
@@ -3,7 +3,6 @@
#include <errno.h>
#include <poll.h>
#include <stdbool.h>
-#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -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);