Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE] MacOS resize not updating stage size #3672

Open
bobaoapae opened this issue Feb 3, 2025 · 0 comments
Open

[ISSUE] MacOS resize not updating stage size #3672

bobaoapae opened this issue Feb 3, 2025 · 0 comments
Labels

Comments

@bobaoapae
Copy link

On MacOS when resizing the application with scaleMode: EXACT_FIT the stage keep the initial width and height without update.
Checking on nativeWindow of the stage the new size it's correct, just can't be used due to size of nativeWindow not being the same of the stage due to the systemChrome.

The same code on Windows and Android works without problem.

public static function setup(param1:Stage):void
    {
        _stage = param1;
        _stage.nativeWindow.addEventListener(NativeWindowBoundsEvent.RESIZE, __onResize);
        _stage.stageFocusRect = false;
    }

    private static function __onResize(param1:NativeWindowBoundsEvent):void
    {
        var afterBounds:Rectangle = param1.afterBounds;
        var nativeWidth:Number = _stage.nativeWindow.width;
        var nativeHeight:Number = _stage.nativeWindow.height;
        stageWidth = _stage.stageWidth;
        stageHeight = _stage.stageHeight;
        var logData:Object = {
            "stageWidth": stageWidth,
            "stageHeight": stageHeight,
            "nativeWidth": nativeWidth,
            "nativeHeight": nativeHeight,
            "afterBounds": {
                "width": afterBounds.width,
                "height": afterBounds.height
            }
        }
        trace("[StageReferance] Stage resize: " + JSON.stringify(logData));
        _stage.dispatchEvent(new Event(Event.RESIZE));
    }
@bobaoapae bobaoapae added the Bug label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant