diff --git a/shell/browser/api/electron_api_base_window.cc b/shell/browser/api/electron_api_base_window.cc index b795b5eeb2..a06e9d8d5f 100644 --- a/shell/browser/api/electron_api_base_window.cc +++ b/shell/browser/api/electron_api_base_window.cc @@ -684,7 +684,7 @@ double BaseWindow::GetOpacity() const { } void BaseWindow::SetShape(const std::vector& rects) { - window_->widget()->SetShape(std::make_unique>(rects)); + window_->SetShape(rects); } void BaseWindow::SetRepresentedFilename(const std::string& filename) { diff --git a/shell/browser/native_window.cc b/shell/browser/native_window.cc index a456d6b517..486889cfbb 100644 --- a/shell/browser/native_window.cc +++ b/shell/browser/native_window.cc @@ -289,6 +289,10 @@ NativeWindow* NativeWindow::FromWidget(const views::Widget* widget) { widget->GetNativeWindowProperty(kNativeWindowKey.c_str())); } +void NativeWindow::SetShape(const std::vector& rects) { + widget()->SetShape(std::make_unique>(rects)); +} + void NativeWindow::SetSize(const gfx::Size& size, bool animate) { SetBounds(gfx::Rect(GetPosition(), size), animate); } diff --git a/shell/browser/native_window.h b/shell/browser/native_window.h index 2725a2ad17..f3bc8cceda 100644 --- a/shell/browser/native_window.h +++ b/shell/browser/native_window.h @@ -101,9 +101,10 @@ class NativeWindow : public base::SupportsUserData, virtual bool IsMinimized() const = 0; virtual void SetFullScreen(bool fullscreen) = 0; virtual bool IsFullscreen() const = 0; + virtual void SetBounds(const gfx::Rect& bounds, bool animate = false) = 0; virtual gfx::Rect GetBounds() const = 0; - + void SetShape(const std::vector& rects); void SetSize(const gfx::Size& size, bool animate = false); [[nodiscard]] gfx::Size GetSize() const;