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

Unified Diff: ui/aura/shared/compound_event_filter.cc

Issue 10982040: Fix mouse lock on chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment Created 8 years, 3 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 | « ui/aura/shared/compound_event_filter.h ('k') | ui/aura/shared/compound_event_filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/shared/compound_event_filter.cc
diff --git a/ui/aura/shared/compound_event_filter.cc b/ui/aura/shared/compound_event_filter.cc
index 2f51f63eab0f5fa4399a1bd134ac0b6b73175e22..0471819c91b1084a294dab669077d3bfb9b4485b 100644
--- a/ui/aura/shared/compound_event_filter.cc
+++ b/ui/aura/shared/compound_event_filter.cc
@@ -37,7 +37,7 @@ Window* GetActiveWindow(Window* window) {
////////////////////////////////////////////////////////////////////////////////
// CompoundEventFilter, public:
-CompoundEventFilter::CompoundEventFilter() : update_cursor_visibility_(true) {
+CompoundEventFilter::CompoundEventFilter() : cursor_hidden_by_filter_(false) {
}
CompoundEventFilter::~CompoundEventFilter() {
@@ -147,11 +147,19 @@ ui::TouchStatus CompoundEventFilter::FilterTouchEvent(
void CompoundEventFilter::SetCursorVisibilityOnEvent(aura::Window* target,
ui::Event* event,
bool show) {
- if (update_cursor_visibility_ && !(event->flags() & ui::EF_IS_SYNTHESIZED)) {
+ if (!(event->flags() & ui::EF_IS_SYNTHESIZED)) {
client::CursorClient* client =
client::GetCursorClient(target->GetRootWindow());
- if (client)
- client->ShowCursor(show);
+ if (client) {
+ if (show && cursor_hidden_by_filter_) {
+ cursor_hidden_by_filter_ = false;
+ client->ShowCursor(true);
+ } else if (client->IsCursorVisible() && !show &&
+ !cursor_hidden_by_filter_) {
+ cursor_hidden_by_filter_ = true;
+ client->ShowCursor(false);
+ }
+ }
}
}
« no previous file with comments | « ui/aura/shared/compound_event_filter.h ('k') | ui/aura/shared/compound_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698