summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-03-30 08:57:50 +0200
committerGitHub <noreply@github.com>2022-03-30 08:57:50 +0200
commitdc4a5b2d5d5c6877a2ebc81d32064e3e4beca4ce (patch)
treef00dceca86e447bd16fd8b94855a4fda3511471c
parentdab46db6190e98811ac84101e36ae64c8201282a (diff)
parentba208df6e6629727f8702b85a5c025875cb41adb (diff)
Merge pull request #59568 from Sauermann/fix-focus-out-notification
Send a focus-out notification when opening a Window Manager Popup
-rw-r--r--scene/main/window.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index 6837fcae21..62e8e7fea7 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -1101,6 +1101,14 @@ void Window::popup_centered_ratio(float p_ratio) {
void Window::popup(const Rect2i &p_screen_rect) {
emit_signal(SNAME("about_to_popup"));
+ if (!_get_embedder() && get_flag(FLAG_POPUP)) {
+ // Send a focus-out notification when opening a Window Manager Popup.
+ SceneTree *scene_tree = get_tree();
+ if (scene_tree) {
+ scene_tree->notify_group("_viewports", NOTIFICATION_WM_WINDOW_FOCUS_OUT);
+ }
+ }
+
// Update window size to calculate the actual window size based on contents minimum size and minimum size.
_update_window_size();