winit-sonoma-fix/src/platform_impl/linux
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
..
wayland Reverse horizontal scroll direction (#2105) 2022-03-13 14:22:02 +01:00
x11 Fix scale factor calculation when the only monitor is reconnected 2022-03-31 17:43:48 +03:00
mod.rs feat: add Window::is_visible (#2169) 2022-02-17 19:44:14 +01:00