Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mac] Map changes resolution when moved to secondary screen #2508

Closed
mcocaroUX opened this issue Feb 21, 2024 · 2 comments
Closed

[Mac] Map changes resolution when moved to secondary screen #2508

mcocaroUX opened this issue Feb 21, 2024 · 2 comments

Comments

@mcocaroUX
Copy link

mcocaroUX commented Feb 21, 2024

Mapsui Version
Mapsui.Uno.WinUI 4.1.3

Mapsui Platform
Mac, bug is not present on Windows

Device
Macbook Pro
macOS: Sonoma 14.2.1
MainScreen: Built-in 15,4" 2880x1800
SecondaryScreen: Generic monitor 1920x1080 24"

Describe the bug
We currently have in prod an Windows UNO app, we plan to release it for mac soon.
While doing some tests on the mac, we noticed when we moved the app window to a extenrnal/secondary screen the map seems to change it resolution, which causes:

  • Pixelated map
  • Widgets dissapear (probably get moved out of view)
  • Info event returning incorrect coordinates (looks like there is some offset)

To Reproduce
Steps to reproduce the behavior:

  1. Run app with any map
  2. Move app window to other display

Expected behavior
Map should not change

Screenshots
On main screen:
image

On secondary screen:
image

Let me know if theres any other info I can provide, as we are running on a tight schedule
Thanks!

@pauldendulk
Copy link
Member

Thanks for you clear bug report. What you describe seems like a problem with PixelDensity. It may not be a Mac specific problem but a problem that shows if you work with two monitors with a different density. You can request the density in the MainPage of you app with:

var pixelDensity = XamlRoot?.RasterizationScale;

Could you check that? Perhaps you need to start the app in a specific screen to get a correct value.

I am testing on Windows and can not reproduce it there, but that may be because of my monitors.

Looking at our code just now I think it is more likely that this is a bug in SkiaSharp or Uno. We do not store the PixelDensity but request it on every iteration. I don't know what else we could do to fix this.

I also found another problem and that is that the mouse wheel event is not fired on my second monitor unless I have the pointer near the top left (it seems 1/16th of the screen area).

@mcocaroUX
Copy link
Author

@pauldendulk. I checked the pixiel density and doesn't seem to change when switching screens, as it does on windows (just tested on both platforms). I'll raise an issue to UNO. Thanks for your help!

@mcocaroUX mcocaroUX changed the title [Mac] Map changes resoluion when moved to secondary screen [Mac] Map changes resolution when moved to secondary screen Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants