mirror of
https://github.com/labwc/labwc.git
synced 2025-11-05 13:29:58 -05:00
menu: move already-on-selected-item check
...menu_process_item_selection() as the previous variant did not work.
This commit is contained in:
parent
38a60b04d9
commit
0671a3bfd3
1 changed files with 7 additions and 6 deletions
|
|
@ -874,6 +874,13 @@ menu_process_item_selection(struct menuitem *item)
|
||||||
{
|
{
|
||||||
assert(item);
|
assert(item);
|
||||||
|
|
||||||
|
/* Do not keep selecting the same item */
|
||||||
|
static struct menuitem *last;
|
||||||
|
if (item == last) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
last = item;
|
||||||
|
|
||||||
if (!item->selectable) {
|
if (!item->selectable) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1042,12 +1049,6 @@ menu_process_cursor_motion(struct wlr_scene_node *node)
|
||||||
{
|
{
|
||||||
assert(node && node->data);
|
assert(node && node->data);
|
||||||
struct menuitem *item = node_menuitem_from_node(node);
|
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);
|
menu_process_item_selection(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue