diff options
-rw-r--r-- | views/mouse_watcher.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/views/mouse_watcher.cc b/views/mouse_watcher.cc index c535f14..990e2f5 100644 --- a/views/mouse_watcher.cc +++ b/views/mouse_watcher.cc @@ -96,8 +96,12 @@ class MouseWatcher::Observer : public MessageLoopForUI::Observer { // Returns true if the mouse is over the view's window. bool IsMouseOverWindow() { + Window* window = view()->GetWindow(); + if (!window) + return false; + return Screen::GetWindowAtCursorScreenPoint() == - view()->GetWindow()->GetNativeWindow(); + window->GetNativeWindow(); } // Called from the message loop observer when a mouse movement has occurred. |