mirror of
https://github.com/storytold/winit.git
synced 2026-11-25 13:50:47 +01:00
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 change125ee0b, 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 by125ee0b. Fixes #2123.