diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 2c28dc31d60..a97a5f38bc7 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -1142,7 +1142,10 @@ void Window::_update_viewport_size() { } } - notification(NOTIFICATION_WM_SIZE_CHANGED); + if (old_size != size) { + old_size = size; + notification(NOTIFICATION_WM_SIZE_CHANGED); + } if (embedder) { embedder->_sub_window_update(this); diff --git a/scene/main/window.h b/scene/main/window.h index 8a54b6c7d3e..512b83216ac 100644 --- a/scene/main/window.h +++ b/scene/main/window.h @@ -117,6 +117,7 @@ private: mutable Size2i size = Size2i(DEFAULT_WINDOW_SIZE, DEFAULT_WINDOW_SIZE); mutable Size2i min_size; mutable Size2i max_size; + mutable Size2i old_size = size; mutable Vector mpath; mutable Mode mode = MODE_WINDOWED; mutable bool flags[FLAG_MAX] = {};