diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2014-11-02 07:58:45 +0200 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2014-11-02 07:58:45 +0200 |
commit | a90bf2f512e9b3cdb6436cf7dce71ec33d1fa680 (patch) | |
tree | 52638346972553e09953aa0ed38087cdfc175514 /lib/renderers/wayland/wayland.c | |
parent | e8fc51d80cdd955f47113f63e22068f3a00d4224 (diff) | |
download | bemenu-a90bf2f512e9b3cdb6436cf7dce71ec33d1fa680.tar.gz bemenu-a90bf2f512e9b3cdb6436cf7dce71ec33d1fa680.tar.bz2 bemenu-a90bf2f512e9b3cdb6436cf7dce71ec33d1fa680.zip |
Redraw only when input changed.
Diffstat (limited to 'lib/renderers/wayland/wayland.c')
-rw-r--r-- | lib/renderers/wayland/wayland.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/renderers/wayland/wayland.c b/lib/renderers/wayland/wayland.c index 2cdedec..3852a6d 100644 --- a/lib/renderers/wayland/wayland.c +++ b/lib/renderers/wayland/wayland.c @@ -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 |