Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/exo/pointer.h" | 5 #include "components/exo/pointer.h" |
| 6 | 6 |
| 7 #include "ash/common/display/display_info.h" | 7 #include "ash/common/display/display_info.h" |
| 8 #include "ash/common/shell_window_ids.h" | 8 #include "ash/common/shell_window_ids.h" |
| 9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
| 10 #include "components/exo/pointer_delegate.h" | 10 #include "components/exo/pointer_delegate.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 void Pointer::SetStylusDelegate(PointerStylusDelegate* delegate) { | 123 void Pointer::SetStylusDelegate(PointerStylusDelegate* delegate) { |
| 124 stylus_delegate_ = delegate; | 124 stylus_delegate_ = delegate; |
| 125 } | 125 } |
| 126 | 126 |
| 127 //////////////////////////////////////////////////////////////////////////////// | 127 //////////////////////////////////////////////////////////////////////////////// |
| 128 // ui::EventHandler overrides: | 128 // ui::EventHandler overrides: |
| 129 | 129 |
| 130 void Pointer::OnMouseEvent(ui::MouseEvent* event) { | 130 void Pointer::OnMouseEvent(ui::MouseEvent* event) { |
| 131 Surface* target = GetEffectiveTargetForEvent(event); | 131 Surface* target = GetEffectiveTargetForEvent(event); |
| 132 | 132 |
| 133 if (target == surface_) | |
|
reveman
2016/08/22 13:41:42
why is this needed?
Peng
2016/08/22 14:32:40
I don't why, but on mus-ash, this surface_ will ge
reveman
2016/08/22 15:44:08
correct this is the surface for the cursor sprite.
Peng
2016/08/22 16:15:14
I think it must be a bug in mus+ash. I filed a bug
| |
| 134 return; | |
| 135 | |
| 133 // If target is different than the current pointer focus then we need to | 136 // If target is different than the current pointer focus then we need to |
| 134 // generate enter and leave events. | 137 // generate enter and leave events. |
| 135 if (target != focus_) { | 138 if (target != focus_) { |
| 136 // First generate a leave event if we currently have a target in focus. | 139 // First generate a leave event if we currently have a target in focus. |
| 137 if (focus_) { | 140 if (focus_) { |
| 138 delegate_->OnPointerLeave(focus_); | 141 delegate_->OnPointerLeave(focus_); |
| 139 focus_->RemoveSurfaceObserver(this); | 142 focus_->RemoveSurfaceObserver(this); |
| 140 // Require SetCursor() to be called and cursor to be re-defined in | 143 // Require SetCursor() to be called and cursor to be re-defined in |
| 141 // response to each OnPointerEnter() call. | 144 // response to each OnPointerEnter() call. |
| 142 focus_->UnregisterCursorProvider(this); | 145 focus_->UnregisterCursorProvider(this); |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 352 | 355 |
| 353 if (ui_scale != cursor_scale_) { | 356 if (ui_scale != cursor_scale_) { |
| 354 gfx::Transform transform; | 357 gfx::Transform transform; |
| 355 transform.Scale(ui_scale, ui_scale); | 358 transform.Scale(ui_scale, ui_scale); |
| 356 widget_->GetNativeWindow()->SetTransform(transform); | 359 widget_->GetNativeWindow()->SetTransform(transform); |
| 357 cursor_scale_ = ui_scale; | 360 cursor_scale_ = ui_scale; |
| 358 } | 361 } |
| 359 } | 362 } |
| 360 | 363 |
| 361 } // namespace exo | 364 } // namespace exo |
| OLD | NEW |