From b1a530c76aa779faa8aae7db5c84390c0c6304a8 Mon Sep 17 00:00:00 2001 From: Vladimir Kharitonov Date: Thu, 12 Jan 2023 16:47:19 +0000 Subject: [PATCH] mac: Fix OSR scaling behavior when switching displays (fixes issue #3423) --- libcef/browser/osr/render_widget_host_view_osr.cc | 1 + tests/cefclient/browser/browser_window_osr_mac.mm | 1 + 2 files changed, 2 insertions(+) diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 3dca1225c..874eb3759 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -1079,6 +1079,7 @@ void CefRenderWidgetHostViewOSR::SynchronizeVisualProperties( void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() { TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::OnScreenInfoChanged"); + InvalidateLocalSurfaceId(); if (!render_widget_host_) { return; } diff --git a/tests/cefclient/browser/browser_window_osr_mac.mm b/tests/cefclient/browser/browser_window_osr_mac.mm index daee4abe3..d72f0a9fe 100644 --- a/tests/cefclient/browser/browser_window_osr_mac.mm +++ b/tests/cefclient/browser/browser_window_osr_mac.mm @@ -1232,6 +1232,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) { } - (void)viewDidChangeBackingProperties { + [super viewDidChangeBackingProperties]; const CGFloat device_scale_factor = [self getDeviceScaleFactor]; if (device_scale_factor == device_scale_factor_) {