fix: maximized window bounds when toggle setResizable (#40503)

This commit is contained in:
Tomasz 2023-11-22 07:21:18 +01:00 committed by GitHub
parent 2029224a84
commit 3340bc1bf9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 94 additions and 4 deletions

View file

@ -30,6 +30,16 @@ void ElectronDesktopNativeWidgetAura::InitNativeWidget(
views::DesktopNativeWidgetAura::InitNativeWidget(std::move(params));
}
#if BUILDFLAG(IS_WIN)
void ElectronDesktopNativeWidgetAura::OnSizeConstraintsChanged() {
views::DesktopNativeWidgetAura::OnSizeConstraintsChanged();
// OnSizeConstraintsChanged can remove thick frame depending from
// resizable state, so add it if needed.
native_window_view_->UpdateThickFrame();
}
#endif
void ElectronDesktopNativeWidgetAura::Activate() {
// Activate can cause the focused window to be blurred so only
// call when the window being activated is visible. This prevents

View file

@ -27,6 +27,9 @@ class ElectronDesktopNativeWidgetAura : public views::DesktopNativeWidgetAura {
// views::DesktopNativeWidgetAura:
void InitNativeWidget(views::Widget::InitParams params) override;
#if BUILDFLAG(IS_WIN)
void OnSizeConstraintsChanged() override;
#endif
// internal::NativeWidgetPrivate:
void Activate() override;