From fe2d9e5bdf0cfab338907917f90f0dc1912deccf Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Fri, 9 Jun 2023 08:03:13 +0300 Subject: [PATCH] [macOS] Fix IME focus in popup windows. --- platform/macos/display_server_macos.mm | 4 ++-- platform/macos/godot_content_view.mm | 2 +- platform/macos/godot_window.mm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index 99e3b4dbff3..b77715d6486 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -2338,7 +2338,7 @@ void DisplayServerMacOS::show_window(WindowID p_id) { popup_open(p_id); if ([wd.window_object isMiniaturized]) { return; - } else if (wd.no_focus || wd.is_popup) { + } else if (wd.no_focus) { [wd.window_object orderFront:nil]; } else { [wd.window_object makeKeyAndOrderFront:nil]; @@ -2972,7 +2972,7 @@ void DisplayServerMacOS::window_set_flag(WindowFlags p_flag, bool p_enabled, Win if ([wd.window_object isVisible]) { if ([wd.window_object isMiniaturized]) { return; - } else if (wd.no_focus || wd.is_popup) { + } else if (wd.no_focus) { [wd.window_object orderFront:nil]; } else { [wd.window_object makeKeyAndOrderFront:nil]; diff --git a/platform/macos/godot_content_view.mm b/platform/macos/godot_content_view.mm index aec2ed413a8..3467bf90a1a 100644 --- a/platform/macos/godot_content_view.mm +++ b/platform/macos/godot_content_view.mm @@ -342,7 +342,7 @@ } DisplayServerMacOS::WindowData &wd = ds->get_window(window_id); - return !wd.no_focus && !wd.is_popup; + return !wd.no_focus; } - (BOOL)acceptsFirstResponder { diff --git a/platform/macos/godot_window.mm b/platform/macos/godot_window.mm index 43495e069a3..f4516e5c859 100644 --- a/platform/macos/godot_window.mm +++ b/platform/macos/godot_window.mm @@ -65,7 +65,7 @@ } DisplayServerMacOS::WindowData &wd = ds->get_window(window_id); - return !wd.no_focus && !wd.is_popup; + return !wd.no_focus; } - (BOOL)canBecomeMainWindow {