Skip to content

GetScaleFactorForMonitor changes depending on packaging type #3566

Open
@dalyIsaac

Description

@dalyIsaac

Describe the bug

I have a monitor with 175% scaling. When <WindowsPackageType>None</WindowsPackageType> is set, the scale factor is incorrectly reported as SCALE_140_PERCENT. When the packaging type is not specified, the scale factor is correctly reported as SCALE_175_PERCENT. The app manifest uses PerMonitorV2 DPI awareness in both cases.

Steps to reproduce the bug

  1. Set a secondary monitor as having 175% scaling, with the primary monitor having 100% scaling
  2. Create a new WAS unpackaged app
  3. For each monitor, call GetScaleFactorForMonitor

Expected behavior

The scale factor will be incorrectly reported as SCALE_140_PERCENT.

Screenshots

No response

NuGet package version

Both of:

  • Windows App SDK 1.2.5: 1.2.230313.1
  • Windows App SDK 1.3.0: 1.3.230331000

Packaging type

No response

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

I've made a repo which demonstrates this: https://github.com/dalyIsaac/WindowsMonitorInfo. It renders a list of monitors, their DPIs, resolutions, and scale factors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions