Skip to content

Commit

Permalink
menu: move already-on-selected-item check
Browse files Browse the repository at this point in the history
...menu_process_item_selection() as the previous variant did not work.
  • Loading branch information
johanmalm committed Oct 31, 2023
1 parent 3d472a7 commit 381688f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/menu/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,13 @@ menu_process_item_selection(struct menuitem *item)
{
assert(item);

/* Do not keep selecting the same item */
static struct menuitem *last;
if (item == last) {
return;
}
last = item;

if (!item->selectable) {
return;
}
Expand Down Expand Up @@ -1019,12 +1026,6 @@ menu_process_cursor_motion(struct wlr_scene_node *node)
{
assert(node && node->data);
struct menuitem *item = node_menuitem_from_node(node);

if (item->selectable && node == &item->selected.tree->node) {
/* We are on an already selected item */
return;
}

menu_process_item_selection(item);
}

Expand Down

0 comments on commit 381688f

Please sign in to comment.