Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
1

How to consider "contentsScaleFactor" for each Window of a Multi-Window App?

Participant ,
Jun 05, 2018 Jun 05, 2018

We have a multi-window Flex app which uses requestedDisplayResolution=high.

When a native window of the app is moved from one monitor to another monitor with a

different display-scaling, all contents of all windows will scale, instead of only

the contents of the window which was moved.

Is there any workaround for this issue?

Can this issue be considered as a bug?

I have thought of a self-made solution by checking the contentsScaleFactor (and working with that as scale) for each window but unfortunately, this property of the stage seems to only be able to have one value, which seems to be the value of the stage of last Window which was moved from montitor to monitor.

TOPICS
Development
2.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 05, 2018 Jun 05, 2018

What's your scaleMode? noScale will give you more options to deal with that behavior.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 05, 2018 Jun 05, 2018

[EDIT: Just saw, that the same issue is already reported here: Problems with AIR windows in multi-monitor setup with different font scaling ]

The scaleMode is noScale.

Another issue related to this is, that it is actually not possible to get the real resolution of the screen a window is located at; stage.stageWidth gives a scaled/modified value based on the display zoom factor, which is set in Windows, in combination with stage.contentsScaleFactor only considering "last" window.

Example:

Monitor 1: 3840 x 2160px, 150% Scale

Monitor 2: 1920 x 1080px, 100% Scale

Window 1 on Monitor 1 initially reports stage.contentsScaleFactor = 1.5, which is correct.

Window 2 is created on Monitor 2, reporting stage.contentsScaleFactor = 1, which is also correct - however, Window 1 now also reports contentsScaleFactor = 1, which is not correct.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 06, 2018 Jun 06, 2018

I did a quick testing in AIR 18 and AIR 28 with an empty project that creates nativewindows with a simple text in them and default nativewindowinitoptions. I'm on MAC with double retina screens, tried a bunch of dimension, all scalemodes and my texts never changed. Do you have a simple way to reproduce that or does it only happen with huge resolution?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 06, 2018 Jun 06, 2018

I assume the problem described here is due to Windows 10 adding the option to set a different font scaling per screen. Not sure if that is also possible on Mac OS. So this probably has to be resolved in Air, if right now only one contentsScaleFactor is available on the Stage object. (Or alternatively with an ANE)

Maybe there is a manual workaround though, I remember having a similar problem with OpenOffice, so maybe this works for you. There is an option to disable the auto scaling for the application:

Open Office calc looks different with Windows 10 - Microsoft Community

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jun 06, 2018 Jun 06, 2018

I've never run into that but I can guess a workaround where nativewindow scale is saved, they all use a container on top of their stage and scale change is monitored, if scale changes and is different than the one saved for each window then each window adjust the scale of their top container.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 07, 2018 Jun 07, 2018

Since AIR 22
Flash Player and AIR 22 Release Notes

you can add

< requestedDisplayResolution >high< /requestedDisplayResolution >


and

stage.contentsScaleFactor

AIR content scales according to the value of stage.contentsScaleFactor. Where, the value of stage.contentsScaleFactor would be calculated as


stage.contentsScaleFactor = Current DPI / DPI at 100% (The DPI at 100% for Windows is 96 by default)


However, some of the content on Windows would scale only after the user signs-off and then signs-in again, as prompted by the OS.

In the case where an extended screen is connected, the AIR app would adjust according to the DPI level of the particular screen, where each screen can have its independent DPI level.  Hhigh quality renderings will cover the Stage3D content, vector assets and text, whereas high-resolution bitmap assets will have to be provided by the developer. 

The Stage3D back buffer needs to be configured to the high resolution back buffer which can be done by calling Context3D.configureBackBuffer with the wantsBestResolution parameter set to 'true'. 

The number of Screen pixels for the content will be ActionScript side Flash Pixels * Contents Scale Factor * Contents Scale Factor

Each Window should be its own NativeWindow and so has its own Stage


see the logic of Scaling and centering an interface

Supporting the multiple screen sizes of multiple devices in Adobe AIR | Adobe Developer Connection

eg.

windowObj.stage.scale = value

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 07, 2018 Jun 07, 2018

Like I described above, this seems to be not working properly.

stage.contentsScaleFactor can only have one value. It will always be the same for each window no matter what the real screen/display scaling is. I will create a bug report on this and post the link here

EDIT:

Link to Bug Report for voting:

Tracker (tracker.adobe.com/#/view/AIR-4198669)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 08, 2018 Jun 08, 2018

Thanks for creating the bug report. Voted.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jun 08, 2018 Jun 08, 2018

yeah you're saying it does not work but there is no code


I'm pretty sure your bug report will be better with a small code sample to demo the error

and not setting up the AIR app xml with the "requestedDisplayResolution"
would have unexpected results, but again you didn't say if you were doing that or not

also providing the version of Windows where this happen would probably help

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 18, 2018 Oct 18, 2018

The error is simple to reproduce if you have a windows 10 laptop and an external 4k monitor. Just drag the application window from one screen to another and you will see flickering of the windows size as AIR tries to mach the screen DPI.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 12, 2018 Nov 12, 2018
LATEST

Unfortunately, the latest Adobe AIR 31, with the new ScreenMode API, doesn't fix this issue 😞
The bug is still present.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines