Wayland: Re-enable window restore logic
It was disabled due to issues with HiDPI but it looks like we can work around it by using the window scale.
This commit is contained in:
+11
-1
@@ -6307,11 +6307,21 @@ void EditorNode::_save_window_settings_to_config(Ref<ConfigFile> p_layout, const
|
||||
if (w) {
|
||||
p_layout->set_value(p_section, "screen", w->get_current_screen());
|
||||
|
||||
Size2i win_size = w->get_size();
|
||||
|
||||
if (DisplayServer::get_singleton()->has_feature(DisplayServerEnums::FEATURE_SELF_FITTING_WINDOWS)) {
|
||||
// Work around logical size issues with HiDPI on Wayland. See GH-110643.
|
||||
float win_scale = DisplayServer::get_singleton()->window_get_scale(w->get_window_id());
|
||||
|
||||
win_size.width /= win_scale;
|
||||
win_size.height /= win_scale;
|
||||
}
|
||||
|
||||
Window::Mode mode = w->get_mode();
|
||||
switch (mode) {
|
||||
case Window::MODE_WINDOWED:
|
||||
p_layout->set_value(p_section, "mode", "windowed");
|
||||
p_layout->set_value(p_section, "size", w->get_size());
|
||||
p_layout->set_value(p_section, "size", win_size);
|
||||
break;
|
||||
case Window::MODE_FULLSCREEN:
|
||||
case Window::MODE_EXCLUSIVE_FULLSCREEN:
|
||||
|
||||
Reference in New Issue
Block a user