airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
197 stars 11 forks source link

[Feature Request] Screen::contentScaleFactor #1669

Open itlancer opened 2 years ago

itlancer commented 2 years ago

Feature Description

In some cases applications for multi-screens systems should respect different scaling of different screens. Right now only way to know scaling factor is to move NativeWindow to screen and get it Stage::contentScaleFactor. But it hard overhead, too complex, too many issues in such approach. Moreover sometimes you even cannot "move" NativeWindow to correct screen: https://github.com/airsdk/Adobe-Runtime-Support/issues/1425 So I think AIR should provide contentScaleFactor information for every connected sreen. So developers could provide proper UX for end users with multi-screens systems. It could be implemented as Screen::contentScaleFactor new property for each Screen instance.

Related issues: https://github.com/airsdk/Adobe-Runtime-Support/issues/1425 https://github.com/airsdk/Adobe-Runtime-Support/issues/1668

Known Workarounds

1) Move NativeWindow to target screen and then get it Stage::contentScaleFactor. But too many issues and sometimes it doesn't work as mentioned above. 2) Write native extension for that.

ajwfrost commented 2 years ago

I thought we'd actually done this, but yes it seems not. But a good idea! will add it to the list...

itlancer commented 1 year ago

Tested with latest AIR 50.1.1.2. Now new Screen::contentScaleFactor property available. It works fine with Windows/Android/iOS. But with Linux/macOS it always return 1 even when scaling in OS different. For macOS Stage::contentScaleFactor shows correct result, Screen::contentScaleFactor not. For Linux may be related issues: https://github.com/airsdk/Adobe-Runtime-Support/issues/1879 https://github.com/airsdk/Adobe-Runtime-Support/issues/1123