From ed38bd330258d01dad5e51ac321adfa5ca49d394 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 23 Oct 2024 14:29:03 -0400 Subject: [PATCH] win: Revert screen_1443650 changes (fixes #3744) This change broke tooltip display at 125% scale factor on Windows 10 with high-dpi display. Reopening the original issue #3489. --- patch/patch.cfg | 5 ---- patch/patches/screen_1443650.patch | 42 ------------------------------ 2 files changed, 47 deletions(-) delete mode 100644 patch/patches/screen_1443650.patch diff --git a/patch/patch.cfg b/patch/patch.cfg index 35bcfe3e2..fb953214c 100644 --- a/patch/patch.cfg +++ b/patch/patch.cfg @@ -629,11 +629,6 @@ patches = [ # Create top-level widget type when Widget::InitParams::child is false. 'name': 'ui_views_widget_type' }, - { - # win/linux: Fix rounding errors with Screen[Win] DIP/pixel conversions. - # https://bugs.chromium.org/p/chromium/issues/detail?id=1443650#c18 - 'name': 'screen_1443650' - }, { # mac: Keep bubble popups on-screen. # https://bugs.chromium.org/p/chromium/issues/detail?id=893292#c10 diff --git a/patch/patches/screen_1443650.patch b/patch/patches/screen_1443650.patch deleted file mode 100644 index ea4933ad7..000000000 --- a/patch/patches/screen_1443650.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git ui/display/screen.cc ui/display/screen.cc -index 3090a05e91f31..7fac1b23ffb62 100644 ---- ui/display/screen.cc -+++ ui/display/screen.cc -@@ -108,13 +108,13 @@ base::TimeDelta Screen::CalculateIdleTime() const { - gfx::Rect Screen::ScreenToDIPRectInWindow(gfx::NativeWindow window, - const gfx::Rect& screen_rect) const { - float scale = GetDisplayNearestWindow(window).device_scale_factor(); -- return ScaleToEnclosingRect(screen_rect, 1.0f / scale); -+ return ScaleToEnclosedRect(screen_rect, 1.0f / scale); - } - - gfx::Rect Screen::DIPToScreenRectInWindow(gfx::NativeWindow window, - const gfx::Rect& dip_rect) const { - float scale = GetDisplayNearestWindow(window).device_scale_factor(); -- return ScaleToEnclosingRect(dip_rect, scale); -+ return ScaleToEnclosedRect(dip_rect, scale); - } - - bool Screen::GetDisplayWithDisplayId(int64_t display_id, -diff --git ui/display/win/screen_win.cc ui/display/win/screen_win.cc -index db01034339fda..84cd0ee222ef0 100644 ---- ui/display/win/screen_win.cc -+++ ui/display/win/screen_win.cc -@@ -619,7 +619,7 @@ gfx::Rect ScreenWin::ScreenToDIPRect(HWND hwnd, const gfx::Rect& pixel_bounds) { - gfx::PointF(pixel_bounds.origin()), screen_win_display)); - const float scale_factor = - 1.0f / screen_win_display.display().device_scale_factor(); -- return {origin, ScaleToEnclosingRect(pixel_bounds, scale_factor).size()}; -+ return {origin, ScaleToEnclosedRect(pixel_bounds, scale_factor).size()}; - } - - // static -@@ -634,7 +634,7 @@ gfx::Rect ScreenWin::DIPToScreenRect(HWND hwnd, const gfx::Rect& dip_bounds) { - const gfx::Point origin = - display::win::DIPToScreenPoint(dip_bounds.origin(), screen_win_display); - const float scale_factor = screen_win_display.display().device_scale_factor(); -- return {origin, ScaleToEnclosingRect(dip_bounds, scale_factor).size()}; -+ return {origin, ScaleToEnclosedRect(dip_bounds, scale_factor).size()}; - } - - // static