Commit 1a9ddb7e authored by Zakhar Voit's avatar Zakhar Voit Committed by Commit Bot

[lacros] Fix blurry Lacros window when display scale is fractional

This CL makes sure that LaCros windows receive big enough
wl_output.scale from exo when display scale is fractional by rounding it
up to the closest integer.

This is similar to how other compositors (Mutter, Sway) deal with
fractional scaling: clients are only aware of integer scaling and the
actual contents of windows are scaled down on the compositor side
(it's already done in Aura in our case).

Bug: 1093021
Change-Id: Ia47dd60dc0cb60396028c1ce108e095ecc84884f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2404930Reviewed-by: default avatarMitsuru Oshima (Slow: gardener) <oshima@chromium.org>
Commit-Queue: Zakhar Voit <zvoit@igalia.com>
Cr-Commit-Position: refs/heads/master@{#806494}
parent 834ca090
...@@ -115,11 +115,10 @@ bool WaylandDisplayHandler::SendDisplayMetrics(const display::Display& display, ...@@ -115,11 +115,10 @@ bool WaylandDisplayHandler::SendDisplayMetrics(const display::Display& display,
if (wl_resource_get_version(output_resource_) >= if (wl_resource_get_version(output_resource_) >=
WL_OUTPUT_SCALE_SINCE_VERSION) { WL_OUTPUT_SCALE_SINCE_VERSION) {
// Sending 100% if the scale is less then 100%, because wl_output_send_scale // wl_output only supports integer scaling, so if device scale factor is
// doesn't support fractional scale. // fractional we need to round it up to the closest integer.
wl_output_send_scale( wl_output_send_scale(output_resource_,
output_resource_, std::ceil(display.device_scale_factor()));
std::max(1, static_cast<int32_t>(display.device_scale_factor())));
} }
// TODO(reveman): Send real list of modes. // TODO(reveman): Send real list of modes.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment