diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index 84e5c53ebe65..08b5bc4f7b7a 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -488,6 +488,10 @@ bool Window::IsDocumentEdited() { return window_->IsDocumentEdited(); } +void Window::SetIgnoreMouseEvents(bool ignore) { + return window_->SetIgnoreMouseEvents(ignore); +} + void Window::CapturePage(mate::Arguments* args) { gfx::Rect rect; base::Callback callback; @@ -662,6 +666,7 @@ void Window::BuildPrototype(v8::Isolate* isolate, .SetMethod("getRepresentedFilename", &Window::GetRepresentedFilename) .SetMethod("setDocumentEdited", &Window::SetDocumentEdited) .SetMethod("isDocumentEdited", &Window::IsDocumentEdited) + .SetMethod("setIgnoreMouseEvents", &Window::SetIgnoreMouseEvents) .SetMethod("focusOnWebView", &Window::FocusOnWebView) .SetMethod("blurWebView", &Window::BlurWebView) .SetMethod("isWebViewFocused", &Window::IsWebViewFocused) diff --git a/atom/browser/api/atom_api_window.h b/atom/browser/api/atom_api_window.h index 6d5ce22f4316..3611c6e33fbc 100644 --- a/atom/browser/api/atom_api_window.h +++ b/atom/browser/api/atom_api_window.h @@ -126,6 +126,7 @@ class Window : public mate::TrackableObject, std::string GetRepresentedFilename(); void SetDocumentEdited(bool edited); bool IsDocumentEdited(); + void SetIgnoreMouseEvents(bool ignore); void CapturePage(mate::Arguments* args); void SetProgressBar(double progress); void SetOverlayIcon(const gfx::Image& overlay, diff --git a/atom/browser/native_window.cc b/atom/browser/native_window.cc index a3df240e4d57..787567012676 100644 --- a/atom/browser/native_window.cc +++ b/atom/browser/native_window.cc @@ -245,6 +245,9 @@ bool NativeWindow::IsDocumentEdited() { return false; } +void NativeWindow::SetIgnoreMouseEvents(bool ignore) { +} + void NativeWindow::SetMenu(ui::MenuModel* menu) { } diff --git a/atom/browser/native_window.h b/atom/browser/native_window.h index 0c918d92df99..3eb235b03c66 100644 --- a/atom/browser/native_window.h +++ b/atom/browser/native_window.h @@ -139,6 +139,7 @@ class NativeWindow : public base::SupportsUserData, virtual std::string GetRepresentedFilename(); virtual void SetDocumentEdited(bool edited); virtual bool IsDocumentEdited(); + virtual void SetIgnoreMouseEvents(bool ignore); virtual void SetMenu(ui::MenuModel* menu); virtual bool HasModalDialog(); virtual gfx::NativeWindow GetNativeWindow() = 0; diff --git a/atom/browser/native_window_mac.h b/atom/browser/native_window_mac.h index 08f9198e4ff1..38845140e694 100644 --- a/atom/browser/native_window_mac.h +++ b/atom/browser/native_window_mac.h @@ -62,6 +62,7 @@ class NativeWindowMac : public NativeWindow { std::string GetRepresentedFilename() override; void SetDocumentEdited(bool edited) override; bool IsDocumentEdited() override; + void SetIgnoreMouseEvents(bool ignore) override; bool HasModalDialog() override; gfx::NativeWindow GetNativeWindow() override; void SetProgressBar(double progress) override; diff --git a/atom/browser/native_window_mac.mm b/atom/browser/native_window_mac.mm index 42894c107de4..049c3eefea9f 100644 --- a/atom/browser/native_window_mac.mm +++ b/atom/browser/native_window_mac.mm @@ -687,6 +687,10 @@ bool NativeWindowMac::IsDocumentEdited() { return [window_ isDocumentEdited]; } +void NativeWindowMac::SetIgnoreMouseEvents(bool ignore) { + [window_ setIgnoresMouseEvents:ignore]; +} + bool NativeWindowMac::HasModalDialog() { return [window_ attachedSheet] != nil; }