Skip to main content
Inspiring
June 5, 2018
Question

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

  • June 5, 2018
  • 3 replies
  • 2348 views

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.

This topic has been closed for replies.

3 replies

Known Participant
November 12, 2018

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

Inspiring
June 7, 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

Inspiring
June 8, 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)

Known Participant
June 8, 2018

Thanks for creating the bug report. Voted.

Inspiring
June 5, 2018

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

Inspiring
June 6, 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.

Inspiring
June 6, 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?