summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/menu_bar.cpp5
-rw-r--r--scene/gui/menu_bar.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/scene/gui/menu_bar.cpp b/scene/gui/menu_bar.cpp
index 8aad14e1ec..db06fca587 100644
--- a/scene/gui/menu_bar.cpp
+++ b/scene/gui/menu_bar.cpp
@@ -377,6 +377,11 @@ void MenuBar::_notification(int p_what) {
MutexLock lock(mutex);
Vector2 pos = DisplayServer::get_singleton()->mouse_get_position() - mouse_pos_adjusted - get_global_position();
+ if (pos == old_mouse_pos) {
+ return;
+ }
+ old_mouse_pos = pos;
+
int index = _get_index_at_point(pos);
if (index >= 0 && index != active_menu) {
selected_menu = index;
diff --git a/scene/gui/menu_bar.h b/scene/gui/menu_bar.h
index b7d9933ab2..5aa8ac7324 100644
--- a/scene/gui/menu_bar.h
+++ b/scene/gui/menu_bar.h
@@ -73,6 +73,7 @@ class MenuBar : public Control {
int active_menu = -1;
Vector2i mouse_pos_adjusted;
+ Vector2i old_mouse_pos;
ObjectID shortcut_context;
int _get_index_at_point(const Point2 &p_point) const;