Skip to content

Commit cb3ce85

Browse files
committed
Fix PopupMenu focus issues after Viewport::set_embedding_subwindows is changed.
1 parent 8e2141e commit cb3ce85

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

scene/gui/popup_menu.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,9 +1014,6 @@ void PopupMenu::_notification(int p_what) {
10141014
float pm_delay = pm->get_submenu_popup_delay();
10151015
set_submenu_popup_delay(pm_delay);
10161016
}
1017-
if (!is_embedded()) {
1018-
set_flag(FLAG_NO_FOCUS, true);
1019-
}
10201017
if (system_menu_id != NativeMenu::INVALID_MENU_ID) {
10211018
bind_global_menu();
10221019
}
@@ -2829,6 +2826,8 @@ void PopupMenu::popup(const Rect2i &p_bounds) {
28292826
if (native) {
28302827
NativeMenu::get_singleton()->popup(global_menu, (p_bounds != Rect2i()) ? p_bounds.position : get_position());
28312828
} else {
2829+
set_flag(FLAG_NO_FOCUS, !is_embedded());
2830+
28322831
moved = Vector2();
28332832
popup_time_msec = OS::get_singleton()->get_ticks_msec();
28342833
if (!is_embedded()) {
@@ -2856,6 +2855,8 @@ void PopupMenu::set_visible(bool p_visible) {
28562855
NativeMenu::get_singleton()->popup(global_menu, get_position());
28572856
}
28582857
} else {
2858+
set_flag(FLAG_NO_FOCUS, !is_embedded());
2859+
28592860
Popup::set_visible(p_visible);
28602861
}
28612862
}

0 commit comments

Comments
 (0)