Mouse forward on macOS (#12281)

* Accept mouse events according to the forward parameter on macOS.

* Update BrowserWindow docs: mouse forward is available on macOS
This commit is contained in:
Andreas 2018-04-09 12:35:05 +02:00 committed by Cheng Zhao
parent 0e5aaab0b5
commit 6b5e09478c
3 changed files with 17 additions and 5 deletions

View file

@ -1485,8 +1485,14 @@ bool NativeWindowMac::IsDocumentEdited() {
return [window_ isDocumentEdited];
}
void NativeWindowMac::SetIgnoreMouseEvents(bool ignore, bool) {
void NativeWindowMac::SetIgnoreMouseEvents(bool ignore, bool forward) {
[window_ setIgnoresMouseEvents:ignore];
if (!ignore) {
SetForwardMouseMessages(NO);
} else {
SetForwardMouseMessages(forward);
}
}
void NativeWindowMac::SetContentProtection(bool enable) {
@ -1823,6 +1829,10 @@ void NativeWindowMac::InstallView(NSView* view) {
}
}
void NativeWindowMac::SetForwardMouseMessages(bool forward) {
[window_ setAcceptsMouseMovedEvents:forward];
}
void NativeWindowMac::SetStyleMask(bool on, NSUInteger flag) {
// Changing the styleMask of a frameless windows causes it to change size so
// we explicitly disable resizing while setting it.