feat: 'will-move' event for windows. (#14283)

* feat: 'will-resize' window event (Windows only)

* documentation for 'will-move' event

* comment and line break fix in docs
This commit is contained in:
Siddharth Dalal 2018-08-28 09:44:10 -04:00 committed by Charles Kerr
parent f1fe485768
commit afdb6c5f90
7 changed files with 37 additions and 1 deletions

View file

@ -207,9 +207,16 @@ bool NativeWindowViews::PreHandleMSG(UINT message,
return false;
}
case WM_MOVING: {
if (!movable_)
bool prevent_default = false;
NotifyWindowWillMove(gfx::Rect(*reinterpret_cast<RECT*>(l_param)),
&prevent_default);
if (!movable_ || prevent_default) {
::GetWindowRect(GetAcceleratedWidget(),
reinterpret_cast<RECT*>(l_param));
return true; // Tells Windows that the Move is handled. If not true,
// frameless windows can be moved using
// -webkit-app-region: drag elements.
}
return false;
}
case WM_MOVE: {