Index: ash/pointer_watcher_delegate_aura.cc |
diff --git a/ash/pointer_watcher_delegate_aura.cc b/ash/pointer_watcher_delegate_aura.cc |
index 541a2b5643c1d25ef057667b50c2ce1cc5648b45..d83c33fbb253e38e328f194dc03bbcd412000cf3 100644 |
--- a/ash/pointer_watcher_delegate_aura.cc |
+++ b/ash/pointer_watcher_delegate_aura.cc |
@@ -7,6 +7,7 @@ |
#include "ash/shell.h" |
#include "ui/aura/client/screen_position_client.h" |
#include "ui/aura/window.h" |
+#include "ui/display/screen.h" |
#include "ui/events/event.h" |
#include "ui/events/event_constants.h" |
#include "ui/gfx/geometry/point.h" |
@@ -44,18 +45,12 @@ void PointerWatcherDelegateAura::RemovePointerWatcher( |
} |
void PointerWatcherDelegateAura::OnMouseEvent(ui::MouseEvent* event) { |
- if (event->type() == ui::ET_MOUSE_CAPTURE_CHANGED) { |
- FOR_EACH_OBSERVER(views::PointerWatcher, non_move_watchers_, |
- OnMouseCaptureChanged()); |
- FOR_EACH_OBSERVER(views::PointerWatcher, move_watchers_, |
- OnMouseCaptureChanged()); |
- return; |
- } |
- |
// For compatibility with the mus version, don't send drags. |
if (event->type() != ui::ET_MOUSE_PRESSED && |
event->type() != ui::ET_MOUSE_RELEASED && |
- event->type() != ui::ET_MOUSE_MOVED) |
+ event->type() != ui::ET_MOUSE_MOVED && |
+ event->type() != ui::ET_MOUSEWHEEL && |
+ event->type() != ui::ET_MOUSE_CAPTURE_CHANGED) |
return; |
DCHECK(ui::PointerEvent::CanConvertFrom(*event)); |
@@ -90,8 +85,13 @@ views::Widget* PointerWatcherDelegateAura::GetTargetWidget( |
void PointerWatcherDelegateAura::NotifyWatchers( |
const ui::PointerEvent& event, |
const ui::LocatedEvent& original_event) { |
- const gfx::Point screen_location(GetLocationInScreen(original_event)); |
- views::Widget* target_widget = GetTargetWidget(original_event); |
+ const gfx::Point screen_location = |
+ event.type() == ui::ET_POINTER_CAPTURE_CHANGED |
+ ? display::Screen::GetScreen()->GetCursorScreenPoint() |
+ : GetLocationInScreen(original_event); |
sadrul
2016/08/19 16:38:58
Why do you need a valid location for CAPTURE_CHANG
riajiang
2016/08/19 17:23:42
https://cs.chromium.org/chromium/src/ash/wm/immers
sadrul
2016/08/22 14:55:19
Nope. Good catch. I am beginning to think if we sh
riajiang
2016/08/22 16:03:05
Done.
|
+ views::Widget* target_widget = event.type() == ui::ET_POINTER_CAPTURE_CHANGED |
+ ? nullptr |
+ : GetTargetWidget(original_event); |
sadrul
2016/08/19 16:38:58
Why special case for CAPTURE_CHANGED? Can we fix G
riajiang
2016/08/22 16:03:05
Apparently GetTargetWidget already does the right
|
FOR_EACH_OBSERVER( |
views::PointerWatcher, move_watchers_, |
OnPointerEventObserved(event, screen_location, target_widget)); |