Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Incorrect monitor resolution being reported by display-info crate #46

@THEGOLDENPRO

Description

@THEGOLDENPRO

If you're on a laptop with a 1920x1080 display and it's scale factor is set to 125% like mine the incorrect width and height will be reported by display-info breaking the smart downsampling optimization in Roseate.

See nashaofu/display-info#38

notes from here on...

Current Solution (egui viewport) and ways to deal with changes.

  1. Get egui viewport monitor size initially, if no viewport monitor size initially available default to 1920x1080.
  2. window is active, egui viewport monitor size should be available now
  3. if it's available, cache that (persistent cache) as one of the user's monitor resolutions.
  4. user moves window to 2nd display (with a higher resolution, e.g. 4k)
  5. egui viewport monitor size updates
  6. if the size is bigger than the previously cached size (a bigger monitor), cache that as another monitor size

Roseate is launched a 2nd time

  1. we now have the cached monitor sizes
  2. initially use the highest monitor size from cache (it's better to assume a higher monitor size than lower)
  3. unless the user's config says otherwise (some sort of monitor_size_assumption_priority = "h" key, where h picks the highest resolution, m picks the middle one and l picks the lowest

If something like override_monitor_size is set then all of these checks are prevented and egui viewport monitor size is ignored.

Dynamic Sampling

While egui viewport monitor size is changing the image is also dynamically sampling itself to be the best quality for that current monitor. This will be called "Dynamic Sampling via Monitor Size".

Progress

  • Cache egui viewport monitor size.
  • Update cached monitor size when new monitor size found.
  • Use cached monitor size initially.
  • Add some sort of monitor_size_assumption_priority = "h" key. (skipped)
  • Add override_monitor_size key.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions