From 47a45d557b30016b30c6fba1ad8d0457f439c6d0 Mon Sep 17 00:00:00 2001 From: Willow Barraco Date: Thu, 31 Aug 2023 18:37:38 +0200 Subject: [PATCH] Fix black box on Shift press Drawing key will redraw the bg at the right side. As we already propagated the surface damage, this cause a rewrite of the right side of the layout. --- keyboard.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/keyboard.c b/keyboard.c index 24ba335..d7da08d 100644 --- a/keyboard.c +++ b/keyboard.c @@ -389,11 +389,6 @@ kbd_press_key(struct kbd *kb, struct key *k, uint32_t time) { if (k->code == Shift) { kbd_draw_layout(kb); } - if (kb->mods & k->code) { - kbd_draw_key(kb, k, Press); - } else { - kbd_draw_key(kb, k, Unpress); - } zwp_virtual_keyboard_v1_modifiers(kb->vkbd, kb->mods, 0, 0, 0); break; case Layout: @@ -522,7 +517,7 @@ kbd_draw_key(struct kbd *kb, struct key *k, enum key_draw_type type) { // cleanup cairo mess right side if words too long uint32_t right_part_x = k->x + k->w - 2 * KBD_KEY_BORDER; drw_do_rectangle(d, kb->scheme.bg, right_part_x, k->y, - kb->w - right_part_x, kb->h, false); + kb->w - right_part_x, k->h, false); wl_surface_damage(d->surf, k->x, k->y, k->w, k->h); }