Skip to content

Commit 4ed5193

Browse files
committed
Fix Window.hide() crash when force_native changed
Moved force_native = p_force_native assignment to after is_visible() check, to prevent value from changing after window is shown. Fixes godotengine#90609
1 parent 2886511 commit 4ed5193

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scene/main/window.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,10 +1215,10 @@ void Window::set_force_native(bool p_force_native) {
12151215
if (force_native == p_force_native) {
12161216
return;
12171217
}
1218-
force_native = p_force_native;
12191218
if (is_visible() && !is_in_edited_scene_root()) {
1220-
WARN_PRINT("Can't change \"force_native\" while a window is displayed. Consider hiding window before changing this value.");
1219+
ERR_FAIL_MSG("Can't change \"force_native\" while a window is displayed. Consider hiding window before changing this value.");
12211220
}
1221+
force_native = p_force_native;
12221222
}
12231223

12241224
bool Window::get_force_native() const {

0 commit comments

Comments
 (0)