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.
This commit is contained in:
mojyack 2023-10-30 01:16:17 +09:00 committed by Maarten van Gompel
parent a126945401
commit 5471e2ea0e

4
main.c
View File

@ -342,12 +342,16 @@ void
wl_surface_enter(void *data, struct wl_surface *wl_surface, wl_surface_enter(void *data, struct wl_surface *wl_surface,
struct wl_output *wl_output) struct wl_output *wl_output)
{ {
struct Output *old_output = current_output;
for (int i = 0; i < WL_OUTPUTS_LIMIT; i += 1) { for (int i = 0; i < WL_OUTPUTS_LIMIT; i += 1) {
if (wl_outputs[i].data == wl_output) { if (wl_outputs[i].data == wl_output) {
current_output = &wl_outputs[i]; current_output = &wl_outputs[i];
break; break;
} }
} }
if (current_output == old_output) {
return;
}
keyboard.preferred_scale = current_output->scale; keyboard.preferred_scale = current_output->scale;