Skip to content

Commit

Permalink
Fix first render on Wayland after loading items with --grab
Browse files Browse the repository at this point in the history
Currently, on the Wayland backend, the following command:
    { echo one; sleep 1; echo two; } | BEMENU_BACKEND=wayland bemenu --grab
Will keep showing the 'Loading...' text even after all items are available.
The items will only be shown after some input, e.g. a key press, happens.

This was a regression introduced by 5a09570
(versions 0.6.5+). A dirty flag was added to avoid unnecessary redraws,
however, this flag is not reset between the renders before/after the items are
loaded, so the bm_menu_render call after the items are loaded is ignored
(on Wayland, which is the only renderer that currently uses the dirty flag).

Fix the issue by resetting the flag after it is unset by the first grab render.
  • Loading branch information
joanbm committed Jun 28, 2022
1 parent 84bccc0 commit 3d7e47c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions client/common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ menu_with_options(struct client *client)
// bm_menu_grab_keyboard(menu, true);
bm_menu_render(menu);
bm_menu_set_filter(menu, NULL);
menu->dirty = true; // Ensure a redraw on the first call to bm_menu_render after the items are loaded
}

return menu;
Expand Down

0 comments on commit 3d7e47c

Please sign in to comment.