Fix NOTIFICATION_WM_SIZE_CHANGED firing if the size hasn't changed

This commit is contained in:
Michael Alexsander 2023-10-29 13:27:59 -03:00
parent 6afd320984
commit 62ab9bf1c4
No known key found for this signature in database
GPG key ID: A9C91EE110F4EABA
2 changed files with 5 additions and 1 deletions

View file

@ -1142,7 +1142,10 @@ void Window::_update_viewport_size() {
} }
} }
if (old_size != size) {
old_size = size;
notification(NOTIFICATION_WM_SIZE_CHANGED); notification(NOTIFICATION_WM_SIZE_CHANGED);
}
if (embedder) { if (embedder) {
embedder->_sub_window_update(this); embedder->_sub_window_update(this);

View file

@ -117,6 +117,7 @@ private:
mutable Size2i size = Size2i(DEFAULT_WINDOW_SIZE, DEFAULT_WINDOW_SIZE); mutable Size2i size = Size2i(DEFAULT_WINDOW_SIZE, DEFAULT_WINDOW_SIZE);
mutable Size2i min_size; mutable Size2i min_size;
mutable Size2i max_size; mutable Size2i max_size;
mutable Size2i old_size = size;
mutable Vector<Vector2> mpath; mutable Vector<Vector2> mpath;
mutable Mode mode = MODE_WINDOWED; mutable Mode mode = MODE_WINDOWED;
mutable bool flags[FLAG_MAX] = {}; mutable bool flags[FLAG_MAX] = {};