mirror of
https://github.com/godotengine/godot.git
synced 2025-10-29 12:44:31 +00:00
Fix Embedded Game does not focus when mouse over on Windows
This commit is contained in:
parent
e567f49cbb
commit
c7bc322bf6
2 changed files with 10 additions and 4 deletions
|
|
@ -321,10 +321,15 @@ void EmbeddedProcess::_check_mouse_over() {
|
|||
return;
|
||||
}
|
||||
|
||||
// When there's a modal window, we don't want to grab the focus to prevent
|
||||
// the game window to go in front of the modal window.
|
||||
if (_get_current_modal_window()) {
|
||||
return;
|
||||
// Check if there's an exclusive popup, an open menu, or a tooltip.
|
||||
// We don't want to grab focus to prevent the game window from coming to the front of the modal window
|
||||
// or the open menu from closing when the mouse cursor moves outside the menu and over the embedded game.
|
||||
Vector<DisplayServer::WindowID> wl = DisplayServer::get_singleton()->get_window_list();
|
||||
for (const DisplayServer::WindowID &window_id : wl) {
|
||||
Window *w = Window::get_from_id(window_id);
|
||||
if (w && (w->is_exclusive() || w->get_flag(Window::FLAG_POPUP))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Force "regrabbing" the game window focus.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue