diff --git a/RetroWindowsGUI/DesktopWindow.gd b/RetroWindowsGUI/DesktopWindow.gd index 5cf792f..43ee0e6 100755 --- a/RetroWindowsGUI/DesktopWindow.gd +++ b/RetroWindowsGUI/DesktopWindow.gd @@ -21,13 +21,13 @@ func _input(event: InputEvent): # toggle maximized func toggle_maximized(): - if get_parent() == maximized_windows: + if anchors_preset == Control.PRESET_FULL_RECT: + set_anchors_and_offsets_preset(Control.PRESET_TOP_LEFT) position = windowed_rect.position size = windowed_rect.size - reparent(desktop) else: windowed_rect = get_global_rect() - reparent(maximized_windows) + set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT) func close(): visible = false