forked from RepoMirrors/bemenu
Redraw only when input changed.
This commit is contained in:
parent
e8fc51d80c
commit
a90bf2f512
@ -369,6 +369,7 @@ bm_wl_registry_register(struct wayland *wayland)
|
||||
return false;
|
||||
|
||||
set_repeat_info(&wayland->input, 40, 400);
|
||||
wayland->input.last_code = 0xDEADBEEF;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -38,10 +38,13 @@ render(const struct bm_menu *menu)
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t count;
|
||||
bm_menu_get_filtered_items(menu, &count);
|
||||
uint32_t lines = (count < menu->lines ? count : menu->lines) + 1;
|
||||
bm_wl_window_render(&wayland->window, menu, lines);
|
||||
if (wayland->input.code != wayland->input.last_code) {
|
||||
uint32_t count;
|
||||
bm_menu_get_filtered_items(menu, &count);
|
||||
uint32_t lines = (count < menu->lines ? count : menu->lines) + 1;
|
||||
bm_wl_window_render(&wayland->window, menu, lines);
|
||||
wayland->input.last_code = wayland->input.code;
|
||||
}
|
||||
}
|
||||
|
||||
static enum bm_key
|
||||
|
@ -51,6 +51,7 @@ struct input {
|
||||
|
||||
xkb_keysym_t sym;
|
||||
uint32_t code;
|
||||
uint32_t last_code;
|
||||
uint32_t modifiers;
|
||||
|
||||
xkb_keysym_t repeat_sym;
|
||||
|
Loading…
Reference in New Issue
Block a user