diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2020-09-18 20:45:59 +0200 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2020-09-18 20:45:59 +0200 |
commit | 54eaaf456fd538a73652690d6ff0b34bf7395e28 (patch) | |
tree | ffa2eed52a9fb3cb5504fb0ef17e9627eb2117fb /scene/gui/popup_menu.h | |
parent | 377c3bb25672fb7060cbd465a698661a93290e07 (diff) | |
download | redot-engine-54eaaf456fd538a73652690d6ff0b34bf7395e28.tar.gz |
Fix popup menu item selected when opening the menu
In order to allow selecting items by either holding left click, or click
to open and click again to select, mouse button release was invalidated
based on the amount of mouse motion.
This was causing issues in some scenarios where an item could be
selected while opening the menu if the mouse moved enough between button
press and release.
This case could happen in the language selection of the project manager,
especially on linux, because of the order and timing of the mouse
events on x11.
This change invalidates mouse release based on a timing condition rather
than moved distance to handle any case from the display server properly.
Diffstat (limited to 'scene/gui/popup_menu.h')
-rw-r--r-- | scene/gui/popup_menu.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index 9535fd07d7..e8f82ba869 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -105,7 +105,7 @@ class PopupMenu : public Popup { void _activate_submenu(int over); void _submenu_timeout(); - bool invalidated_click; + uint64_t popup_time_msec = 0; bool hide_on_item_selection; bool hide_on_checkable_item_selection; bool hide_on_multistate_item_selection; |