From 2b2c6aa1433ca89b6a3353ec1a0fdb844ab13c5c Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 6 Jan 2023 15:51:22 -0500 Subject: [PATCH] win: osr: Fix context menu popup placement (fixes issue 3433) --- patch/patches/views_widget.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patch/patches/views_widget.patch b/patch/patches/views_widget.patch index 0dded0b8f..b54bbfb55 100644 --- a/patch/patches/views_widget.patch +++ b/patch/patches/views_widget.patch @@ -258,7 +258,7 @@ index a7d8b09e1d76e..e973baff291c0 100644 // Calculate initial bounds. diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -index ceee9102cf021..00e82621849ea 100644 +index ceee9102cf021..60939d07e402d 100644 --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc @@ -183,16 +183,28 @@ void DesktopWindowTreeHostWin::Init(const Widget::InitParams& params) { @@ -281,7 +281,7 @@ index ceee9102cf021..00e82621849ea 100644 - gfx::Rect pixel_bounds = - display::win::ScreenWin::DIPToScreenRect(nullptr, params.bounds); + gfx::Rect pixel_bounds; -+ if (has_external_parent_) { ++ if (has_external_parent_ && params.type != Widget::InitParams::TYPE_MENU) { + // Scale relative to the screen that contains the parent window. + // Child windows always have origin (0,0). + pixel_bounds.set_size(display::win::ScreenWin::DIPToScreenSize(