Hello!
We have a public safety mapping application that was developed in-house using the ArcGIS Runtime for .NET (WPF).
We recently enabled per-monitor DPI awareness to our WPF application and noticed a new issue with the display of the ArcGIS map. When the window is moved between monitors with different DPI scaling, the map will sometimes go missing. Often it won't reappear on its own until you move it to another monitor.
Use of multiple monitors is a common scenario for our emergency operations center, dispatchers, and command staff so we're hoping to find a solution for this.
I've attached a small sample project using the latest version of ArcGIS Runtime .NET WPF to demonstrate the issue. You'll need to add your API key in app.xaml.cs and restore the nuget packages. The per-monitor DPI awareness is controlled in the app.manifest file.
Steps to reproduce
- Test this on a Windows machine with multiple monitors.
- Make sure to change the Windows display settings on each monitor to use a different DPI scaling (100%, 125%, 150%, etc).
- Build and launch the test application.
- Move the application window back and forth across monitors repeatedly.
Keep doing this and eventually the map will disappear. I put a textbox "Where'd my map go?" underneath the map control in the application to make it more obvious when it goes missing.
Additional Notes
- Although the map goes missing, it still seems to be processing interactions. For example, try zooming using the mouse scroll wheel over where the map should be, and you'll see the scale bar and layer attribution controls update.
- Forcing software rendering in the ArcGIS Runtime seems to resolve the issue, however it creates major performance problems for our officers using mobile computers. So that solution will not work for us unfortunately. i.e. AppContext.SetSwitch("Switch.Esri.ArcGISRuntime.ForceSoftwareRendering", true);
- If all of the monitors have the same DPI scaling set, the problem does not happen.
- I tried replicating the issue with an older version of the runtime (100.11) and it happens with that version too.
- Once the problem happens in a session, it seems more likely to happen in that same session.
P.S. We must enable per-monitor DPI awareness on our application to correct two issues:
- We noticed blurriness in the WPF app and map without per-monitor DPI awareness
- We use Microsoft's WebView2 control in our WPF app to display web content, and there appears to be a bug in WebView2 that requires per-monitor DPI to be enabled to properly display content in some scenarios.
Thank you in advance for your assistance!
-David