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

Unified Diff: components/exo/pointer.cc

Issue 2295513002: exo: Hide cursor for direct input (Closed)
Patch Set: fixed nits 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..86762b1deb9864ddd83738ba5ad1676f2377f451 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 ((event->flags() & ui::EF_IS_SYNTHESIZED) == 0)
+ is_direct_input_ = (event->flags() & ui::EF_DIRECT_INPUT) != 0;
+
// Update cursor widget to reflect current focus and pointer location.
- if (focus_) {
+ if (focus_ && !is_direct_input_) {
if (!widget_)
CreatePointerWidget();
@@ -265,6 +268,8 @@ void Pointer::OnMouseEvent(ui::MouseEvent* event) {
}
UpdateCursorScale();
+ if (!widget_->IsVisible())
+ widget_->Show();
} else {
if (widget_ && widget_->IsVisible())
widget_->Hide();
« 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