winit-sonoma-fix/src/platform_impl
Daniel Müller 6c1d3c4fd8
Fix scale factor calculation when the only monitor is reconnected
The scale factor being sent when the only monitor is disconnected and
reconnected is hard coded to 1.0. That may work by chance, if that's the
scale factor in use currently, but it does not work in the general case.
As a result, clients may end up with wrongly scaled or laid out window
contents after reconnect, as was reported over in
https://github.com/alacritty/alacritty/issues/5703, for example.

The problem was introduced by change 125ee0b, which caused an additional
ScaleFactorChanged event to be sent on monitor reconnect, but got the
scale factor wrong when the only monitor is disconnected and
reconnected.
This change fixes the problem by using the current monitor's scale
factor in this case. The event is still being sent as intended by
125ee0b.

Fixes #2123.
2022-03-31 17:43:48 +03:00
..
android feat: add Window::is_visible (#2169) 2022-02-17 19:44:14 +01:00
ios feat: add Window::is_visible (#2169) 2022-02-17 19:44:14 +01:00
linux Fix scale factor calculation when the only monitor is reconnected 2022-03-31 17:43:48 +03:00
macos macOS set_ime_position fixes (#2180) 2022-03-18 14:50:24 +01:00
web Rename internal structs for consistency (#2149) 2022-03-18 14:09:39 +01:00
windows feat(Windows): add with_msg_hook (#2213) 2022-03-30 10:30:45 +02:00
mod.rs Merge branch 'master' into merge-master-to-web 2019-09-24 14:21:18 -04:00