Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Unified Diff: components/exo/pointer.cc

Issue 2295513002: exo: Hide cursor for direct input (Closed)
Patch Set: adding all the files does help. sometimes. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/exo/pointer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/pointer.cc
diff --git a/components/exo/pointer.cc b/components/exo/pointer.cc
index 750be6157548ad4dd89e9c3598b011f108b8ecd5..2f324b80f7acf292fa593809bd3cbb87b7e15911 100644
--- a/components/exo/pointer.cc
+++ b/components/exo/pointer.cc
@@ -103,7 +103,7 @@ void Pointer::SetCursor(Surface* surface, const gfx::Point& hotspot) {
surface_->window()->Show();
// Show widget now that cursor has been defined.
- if (!widget_->IsVisible())
+ if (!widget_->IsVisible() && !is_direct_input_)
widget_->Show();
}
@@ -251,8 +251,11 @@ void Pointer::OnMouseEvent(ui::MouseEvent* event) {
break;
}
+ if (focus_ && (event->flags() & ui::EF_IS_SYNTHESIZED) == 0)
+ is_direct_input_ = (event->flags() & ui::EF_DIRECT_INPUT) != 0;
reveman 2016/08/30 00:40:49 should we really take "focus_" into account here?
denniskempin 2016/08/30 00:47:25 I removed the check for focus_, but we do need th
reveman 2016/08/30 00:49:43 Got it. Makes sense.
+
// Update cursor widget to reflect current focus and pointer location.
- if (focus_) {
+ if (focus_ && !is_direct_input_) {
if (!widget_)
CreatePointerWidget();
@@ -263,6 +266,8 @@ void Pointer::OnMouseEvent(ui::MouseEvent* event) {
bounds.set_origin(mouse_location);
widget_->SetBounds(bounds);
}
+ if (!widget_->IsVisible())
+ widget_->Show();
reveman 2016/08/30 00:40:49 nit: move below UpdateCursorScale() as better to s
denniskempin 2016/08/30 00:47:25 Done.
UpdateCursorScale();
} else {
« no previous file with comments | « components/exo/pointer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698