[ozone/wayland] Fix force-device-scale-factor command line flag
Fixes browser crash when the --force-device-scale-factor flag is used on 4K monitors and the user is trying to open a popup window. Cause of the crash: ui_scale()/buffer_scale division here https://source.chromium.org/chromium/chromium/src/+/master:ui/ozone/platform/wayland/host/wayland_popup.cc;l=159;drc=1e3319e24d05bef56bcf40b2cacf256e285e1342 resulted in 0 because both methods return integer. This CL also simplifies scaling logic in WaylandPopup and WaylandAuxiliaryWindow. These classes used to convert pixel bounds to DIP before changing them to the coordinates relative to the parent (by applying mixed ui_scale/buffer_scale arithmetic). It's not necessary and doesn't work sometimes when ui_scale != buffer_scale. This CL was tested with --force-device-scale-factor flag as well as on single monitor setups with different scaling. Fixes for multi-monitor setups will be added in a separate CL, because at the moment scaling is not always correctly propagated to each window on them. Bug: 1052685 Change-Id: I6259e62c640e6f9cd6aeee45f27377dfa34d1ee6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2318230Reviewed-by:Maksim Sisov (GMT+3) <msisov@igalia.com> Commit-Queue: Zakhar Voit <zvoit@igalia.com> Cr-Commit-Position: refs/heads/master@{#796345}
Showing
Please register or sign in to comment