From a12694540159811e7b1184d918c8f32b77b76cde Mon Sep 17 00:00:00 2001 From: mojyack Date: Mon, 30 Oct 2023 01:13:23 +0900 Subject: [PATCH] handle screen resize and redraw in layer_surface_configure --- main.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 751d811..b7ea264 100644 --- a/main.c +++ b/main.c @@ -352,6 +352,8 @@ wl_surface_enter(void *data, struct wl_surface *wl_surface, keyboard.preferred_scale = current_output->scale; flip_landscape(); + kbd_resize(&keyboard, layouts, NumLayouts); + drwsurf_flip(&draw_surf); } static void @@ -488,9 +490,6 @@ static void xdg_popup_configure(void *data, struct xdg_popup *xdg_popup, int32_t x, int32_t y, int32_t width, int32_t height) { - kbd_resize(&keyboard, layouts, NumLayouts); - - drwsurf_flip(&draw_surf); } static void @@ -602,9 +601,13 @@ layer_surface_configure(void *data, struct zwlr_layer_surface_v1 *surface, } wl_surface_commit(popup_draw_surf.surf); - } - zwlr_layer_surface_v1_ack_configure(surface, serial); + zwlr_layer_surface_v1_ack_configure(surface, serial); + kbd_resize(&keyboard, layouts, NumLayouts); + drwsurf_flip(&draw_surf); + } else { + zwlr_layer_surface_v1_ack_configure(surface, serial); + } } void