diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2023-06-26 19:07:24 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2023-06-29 13:38:24 +0000 |
| commit | 8f74b1090a6a5297ac7b6710420528ff56ed03d2 (patch) | |
| tree | de928b326d321822df7da822d329cd1803a0e820 /wayland.c | |
| parent | wayland: refactor: surface_scale(): pass wl_window pointer, instead of wayland global (diff) | |
wayland: use legacy scaling until fractional_scale::preferred_scale() has been called
This way, the initial frame is more likely to get scaled correctly;
foot will guess the initial (integer) scale from the available
monitors, and use that. By using legacy scaling, we force the
compositor to down-scale the image to the correct scale factor.
If we use the new fraction scaling method with an integer scaling
factor, the initial frame gets rendered way too big.
Diffstat (limited to 'wayland.c')
| -rw-r--r-- | wayland.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1529,6 +1529,7 @@ static void fractional_scale_preferred_scale( { struct wl_window *win = data; win->scale = (float)scale / 120.; + win->have_preferred_scale = true; LOG_DBG("fractional scale: %.3f", win->scale); update_term_for_output_change(win->term); @@ -1895,7 +1896,7 @@ wayl_surface_scale_explicit_width_height( int width, int height, float scale) { - if (wayl_fractional_scaling(wayl)) { + if (wayl_fractional_scaling(win->term->wl) && win->have_preferred_scale) { #if defined(HAVE_FRACTIONAL_SCALE) LOG_DBG("scaling by a factor of %.2f (fractional scaling)", scale); wp_viewport_set_destination( |
