Fix menu keyboard and controller navigation.

This commit is contained in:
Pāvels Nadtočajevs 2025-07-21 10:03:07 +03:00
parent 71a9948157
commit 2111ff0e2a
No known key found for this signature in database
GPG key ID: 8413210218EF35D2
4 changed files with 66 additions and 47 deletions

View file

@ -2111,6 +2111,14 @@ bool Window::has_focus() const {
return focused;
}
bool Window::has_focus_or_active_popup() const {
ERR_READ_THREAD_GUARD_V(false);
if (window_id != DisplayServer::INVALID_WINDOW_ID) {
return DisplayServer::get_singleton()->window_is_focused(window_id) || (DisplayServer::get_singleton()->window_get_active_popup() == window_id);
}
return focused;
}
void Window::start_drag() {
ERR_MAIN_THREAD_GUARD;
if (window_id != DisplayServer::INVALID_WINDOW_ID) {

View file

@ -419,6 +419,7 @@ public:
void grab_focus();
bool has_focus() const;
bool has_focus_or_active_popup() const;
void start_drag();
void start_resize(DisplayServer::WindowResizeEdge p_edge);