From 5471e2ea0ee5c61e3d8fbf4f39da8b5559f33615 Mon Sep 17 00:00:00 2001 From: mojyack Date: Mon, 30 Oct 2023 01:16:17 +0900 Subject: [PATCH] resize keyboard only when entered to different output the keyboard layout is saved even when hide/show (if output is same). this is old behavior. --- main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.c b/main.c index b7ea264..cec4ee6 100644 --- a/main.c +++ b/main.c @@ -342,12 +342,16 @@ void wl_surface_enter(void *data, struct wl_surface *wl_surface, struct wl_output *wl_output) { + struct Output *old_output = current_output; for (int i = 0; i < WL_OUTPUTS_LIMIT; i += 1) { if (wl_outputs[i].data == wl_output) { current_output = &wl_outputs[i]; break; } } + if (current_output == old_output) { + return; + } keyboard.preferred_scale = current_output->scale;