Skip to content

Commit

Permalink
Merge pull request #85542 from bruvzg/win_title_upd
Browse files Browse the repository at this point in the history
Limit window size updates on title change.
  • Loading branch information
akien-mga committed Dec 4, 2023
2 parents 7b1a5de + 5dd11e8 commit e6d8305
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scene/main/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,13 @@ void Window::set_title(const String &p_title) {
embedder->_sub_window_update(this);
} else if (window_id != DisplayServer::INVALID_WINDOW_ID) {
DisplayServer::get_singleton()->window_set_title(tr_title, window_id);
_update_window_size();
if (keep_title_visible) {
Size2i title_size = DisplayServer::get_singleton()->window_get_title_size(tr_title, window_id);
Size2i size_limit = get_clamped_minimum_size();
if (title_size.x > size_limit.x || title_size.y > size_limit.y) {
_update_window_size();
}
}
}
}

Expand Down

0 comments on commit e6d8305

Please sign in to comment.