Open nicoburns opened 12 months ago
I am able to react to the scale factor change event by registering a callback for windowDidChangeBackingProperties:
(https://developer.apple.com/documentation/appkit/nswindowdelegate/1419517-windowdidchangebackingproperties) in the window delegate similar to https://github.com/rust-windowing/winit/blob/master/src/platform_impl/macos/window_delegate.rs#L156C18-L156C50.
I am also able to retrieve the correct scale factor after this point. But unfortunately rendering still seems to be messed up.
Correct rendering:
After dragging from HiDPI (scale factor 2.0)-> Regular DPI (scale factor 1.0):
After dragging from Regular DPI (scale factor 1.0) -> HiDPI (scale factor 2.0):
The correct rendering is "anchored" to whichever screen the app first launched on and always shows correctly on that screen.
Tested on: macOS
Tested with:
Dragging a window between monitors with different scale factors causes the rendering to mess up (either scale too large or too small depending on which direction the window was dragged). And this is not corrected by forcing a repaint via resizing the window.
I added a
scale
function yo the implementation ofWinHandler
in Xilem, and it is not being called when I drag the window between screens.