lime icon indicating copy to clipboard operation
lime copied to clipboard

App become forced to fullscreen after update

Open Sirox0 opened this issue 3 years ago • 21 comments

i have make my app 1280×720 in project.xml, but after update, it became forced to fullscreen and this causing a couple of bugs because app is made for 1280×720, please fix this issue

Sirox0 avatar Aug 31 '22 19:08 Sirox0

@Sirox228 Are you using OpenFL too? Or only Lime?

joshtynjala avatar Aug 31 '22 19:08 joshtynjala

@joshtynjala i use openfl too

Sirox0 avatar Aug 31 '22 19:08 Sirox0

The same issue happens to me, I've set the app Width to 640 and height to 480 and in full screen the application window just ignore it, look a prove IMG_20220831_224914

MAJigsaw77 avatar Aug 31 '22 19:08 MAJigsaw77

@Sirox228 A couple of questions for you.

Do you have allow-high-dpi="true" in your project.xml file? We made some improvements to how things are scaled on desktop HiDPI screens. Previously, you needed to manually scale. Now, it happens automatically. If you have allow-high-dpi="true", can you try adding <haxedef name="openfl_dpi_aware"/> to your project.xml?

We also added a proper implementation of stage.scaleMode, which didn't work properly in previous versions. If you were setting stage.scaleMode to anything other than NO_SCALE, it will behave differently now.

If neither of those things provides any clues, we'd need some more information to understand what's going wrong. A screenshot of what you saw in the previous version versus what changed in the new version would help. It would also help to know which platform you are targeting (windows, mac, ios, android, html5, hl, neko, etc.).

joshtynjala avatar Aug 31 '22 19:08 joshtynjala

@MAJigsaw77 Are you using fullScreenSourceRect? I think that when an app goes full screen, it is supposed to resize automatically. I think that fullScreenSourceRect is required to set a specific size when the app is full screen.

joshtynjala avatar Aug 31 '22 20:08 joshtynjala

@joshtynjala i don't have any of defines you wrote in that comment, also i don't use openfl stage, basically my app works on haxeFlixel that uses Flash stage instead of openfl one (but still based on openfl and lime though)

Sirox0 avatar Aug 31 '22 20:08 Sirox0

HaxeFlixel uses OpenFL's stage, even if it calls it flash.display.Stage.

My question is, can you reproduce the issue in a sample project? (Create a fresh project, set the window dimensions in project.xml, and test it.)

player-03 avatar Aug 31 '22 20:08 player-03

HaxeFlixel uses OpenFL's stage, even if it calls it flash.display.Stage.

My question is, can you reproduce the issue in a sample project? (Create a fresh project, set the window dimensions in project.xml, and test it.)

Let me try

MAJigsaw77 avatar Aug 31 '22 20:08 MAJigsaw77

@MAJigsaw77 Are you using fullScreenSourceRect? I think that when an app goes full screen, it is supposed to resize automatically. I think that fullScreenSourceRect is required to set a specific size when the app is full screen.

I didn't use it, it was normal before

MAJigsaw77 avatar Aug 31 '22 20:08 MAJigsaw77

I think I found the change that may be causing this, and it's an intentional change in OpenFL. You're going to need to change your code to make it work the same before. This is because the older version of OpenFL was behaving differently than Flash before, and now it's matching Flash's behavior more closely.

In 9.1.0, we had this in Stage.__resize:

if (__logicalWidth == 0 && __logicalHeight == 0)

In 9.2.0, we have this instead:

if (__logicalWidth == 0 || __logicalHeight == 0 || scaleMode == NO_SCALE || windowWidth == 0 || windowHeight == 0)

By default, scaleMode == NO_SCALE. So the simpler if condition was evaluating as false in 9.1.0, and now it's true in 9.2.0. So OpenFL is following a different code path now than it was previously, and that is causing it to resize a bit differently when in full screen. However, it's doing things corretly now, and it could have been considered a bug previously.

There are two ways to adapt to this change to OpenFL.

  1. Set stage.scaleMode to something other than NO_SCALE. For instance, EXACT_FIT, SHOW_ALL, or NO_BORDER. Each one scales things differently, so you might need to try them all to be sure that it works the way that you expect.

  2. Set fullScreenSourceRect to the exact stage dimensions that you want when the window is full screen. So if you want 1280×720, I think that it might be new Rectangle(0, 0, 1280, 720).

joshtynjala avatar Aug 31 '22 20:08 joshtynjala

I'll try

MAJigsaw77 avatar Aug 31 '22 20:08 MAJigsaw77

Nothing changed, I think I'll stay on openfl 9.1.0

MAJigsaw77 avatar Sep 01 '22 20:09 MAJigsaw77

It's possible that Flixel may require an update.

dimensionscape avatar Sep 01 '22 20:09 dimensionscape

Idk

MAJigsaw77 avatar Sep 02 '22 04:09 MAJigsaw77

@joshtynjala this is EXACT_FIT on android Screenshot_2022-11-20-16-27-21-034_com majigsaw testbase

MAJigsaw77 avatar Nov 20 '22 14:11 MAJigsaw77

@joshtynjala This is SHOW_ALL Screenshot_2022-11-20-17-10-02-720_com majigsaw testbase

MAJigsaw77 avatar Nov 20 '22 15:11 MAJigsaw77

@joshtynjala This is NO_BORDER Screenshot_2022-11-20-17-50-00-309_com majigsaw testbase

MAJigsaw77 avatar Nov 20 '22 15:11 MAJigsaw77

All of them doesn't look like how was before.

MAJigsaw77 avatar Nov 20 '22 15:11 MAJigsaw77

I'm thinking that scaleModes are messed up. They ware better before, even if they aren't the same like Flash

MAJigsaw77 avatar Nov 20 '22 15:11 MAJigsaw77

i'm having the same issue

furretpaws avatar Nov 21 '22 20:11 furretpaws

@Sirox228 A couple of questions for you.

Do you have allow-high-dpi="true" in your project.xml file? We made some improvements to how things are scaled on desktop HiDPI screens. Previously, you needed to manually scale. Now, it happens automatically. If you have allow-high-dpi="true", can you try adding <haxedef name="openfl_dpi_aware"/> to your project.xml?

We also added a proper implementation of stage.scaleMode, which didn't work properly in previous versions. If you were setting stage.scaleMode to anything other than NO_SCALE, it will behave differently now.

If neither of those things provides any clues, we'd need some more information to understand what's going wrong. A screenshot of what you saw in the previous version versus what changed in the new version would help. It would also help to know which platform you are targeting (windows, mac, ios, android, html5, hl, neko, etc.).

this works fine but fps counter and mouse cursor is still small

mcagabe19 avatar Nov 30 '22 16:11 mcagabe19