From 9eb89b4ac712adfc23b7dbd4fc5dea9853988e73 Mon Sep 17 00:00:00 2001 From: Micha Hanselmann Date: Wed, 7 Aug 2019 19:58:56 -0700 Subject: [PATCH] fix: return correct bounds on will-resize (#19639) --- shell/browser/ui/cocoa/atom_ns_window_delegate.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/shell/browser/ui/cocoa/atom_ns_window_delegate.mm b/shell/browser/ui/cocoa/atom_ns_window_delegate.mm index 3b9e498f64bb..b67b10c7d3f6 100644 --- a/shell/browser/ui/cocoa/atom_ns_window_delegate.mm +++ b/shell/browser/ui/cocoa/atom_ns_window_delegate.mm @@ -12,6 +12,7 @@ #include "shell/browser/native_window_mac.h" #include "shell/browser/ui/cocoa/atom_preview_item.h" #include "shell/browser/ui/cocoa/atom_touch_bar.h" +#include "ui/gfx/mac/coordinate_conversion.h" #include "ui/views/cocoa/native_widget_mac_ns_window_host.h" #include "ui/views/widget/native_widget_mac.h" @@ -120,8 +121,10 @@ using TitleBarStyle = electron::NativeWindowMac::TitleBarStyle; { bool prevent_default = false; - gfx::Rect new_bounds(gfx::Point(sender.frame.origin), gfx::Size(newSize)); - shell_->NotifyWindowWillResize(new_bounds, &prevent_default); + NSRect new_bounds = NSMakeRect(sender.frame.origin.x, sender.frame.origin.y, + newSize.width, newSize.height); + shell_->NotifyWindowWillResize(gfx::ScreenRectFromNSRect(new_bounds), + &prevent_default); if (prevent_default) { return sender.frame.size; }