Window: don't use separate __visible and __hidden private variables

They were getting out of sync on native, which caused OpenFL to think the window was visible, when it wasn't.

Followup to commit 6450e5b.
This commit is contained in:
Josh Tynjala
2025-10-06 10:28:42 -07:00
parent 9bea6169bf
commit c3852d7fcd

View File

@@ -159,7 +159,6 @@ class Window
@:noCompletion private var __resizable:Bool;
@:noCompletion private var __scale:Float;
@:noCompletion private var __title:String;
@:noCompletion private var __visible:Bool;
@:noCompletion private var __width:Int;
@:noCompletion private var __x:Int;
@:noCompletion private var __y:Int;
@@ -214,7 +213,7 @@ class Window
__x = 0;
__y = 0;
__title = Reflect.hasField(__attributes, "title") ? __attributes.title : "";
__visible = true;
__hidden = false;
__borderless = Reflect.hasField(__attributes, "borderless") ? __attributes.borderless : false;
__resizable = Reflect.hasField(__attributes, "resizable") ? __attributes.resizable : false;
__maximized = Reflect.hasField(__attributes, "maximized") ? __attributes.maximized : false;
@@ -727,13 +726,13 @@ class Window
@:noCompletion private inline function get_visible():Bool
{
return __visible;
return !__hidden;
}
@:noCompletion private function set_visible(value:Bool):Bool
{
__visible = __backend.setVisible(value);
return __visible;
__hidden = !__backend.setVisible(value);
return !__hidden;
}
@:noCompletion private inline function get_width():Int