fix: allow chromium to handle WM_NCCALCSIZE for frameless windows (#21164)
This commit is contained in:
parent
c8ed22def3
commit
73467f00e3
8 changed files with 205 additions and 206 deletions
|
@ -4,6 +4,8 @@
|
|||
|
||||
#include "shell/browser/ui/win/atom_desktop_window_tree_host_win.h"
|
||||
|
||||
#include "ui/base/win/hwnd_metrics.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
AtomDesktopWindowTreeHostWin::AtomDesktopWindowTreeHostWin(
|
||||
|
@ -29,4 +31,17 @@ bool AtomDesktopWindowTreeHostWin::HasNativeFrame() const {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool AtomDesktopWindowTreeHostWin::GetClientAreaInsets(gfx::Insets* insets,
|
||||
HMONITOR monitor) const {
|
||||
if (IsMaximized() && !native_window_view_->has_frame()) {
|
||||
// Windows automatically adds a standard width border to all sides when a
|
||||
// window is maximized.
|
||||
int frame_thickness = ui::GetFrameThickness(monitor) - 1;
|
||||
*insets = gfx::Insets(frame_thickness, frame_thickness, frame_thickness,
|
||||
frame_thickness);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
|
|
@ -25,6 +25,8 @@ class AtomDesktopWindowTreeHostWin : public views::DesktopWindowTreeHostWin {
|
|||
LPARAM l_param,
|
||||
LRESULT* result) override;
|
||||
bool HasNativeFrame() const override;
|
||||
bool GetClientAreaInsets(gfx::Insets* insets,
|
||||
HMONITOR monitor) const override;
|
||||
|
||||
private:
|
||||
NativeWindowViews* native_window_view_; // weak ref
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue