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

Side by Side Diff: ui/aura/root_window.cc

Issue 160563002: Aura: don't synthesize mouse moves while holding pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/aura/root_window_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/aura/root_window.h" 5 #include "ui/aura/root_window.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 } 769 }
770 770
771 if (!dispatch_details.dispatcher_destroyed) 771 if (!dispatch_details.dispatcher_destroyed)
772 dispatching_held_event_ = false; 772 dispatching_held_event_ = false;
773 return dispatch_details; 773 return dispatch_details;
774 } 774 }
775 775
776 void RootWindow::PostMouseMoveEventAfterWindowChange() { 776 void RootWindow::PostMouseMoveEventAfterWindowChange() {
777 if (synthesize_mouse_move_) 777 if (synthesize_mouse_move_)
778 return; 778 return;
779 // Don't synthesize mouse move while holding mouse.
780 // We also clear the held move event since held event target location may
781 // be wrong now (see comments in DispatchHeldEvents).
782 if (move_hold_count_) {
783 if (held_move_event_ && !dispatching_held_event_)
784 held_move_event_.reset();
785 return;
sky 2014/02/13 17:49:04 If you do this, don't we need to ensure when mouse
dgozman 2014/02/13 17:55:06 There is already a drop of held moves on the line
786 }
779 synthesize_mouse_move_ = true; 787 synthesize_mouse_move_ = true;
780 base::MessageLoop::current()->PostNonNestableTask( 788 base::MessageLoop::current()->PostNonNestableTask(
781 FROM_HERE, 789 FROM_HERE,
782 base::Bind(base::IgnoreResult(&RootWindow::SynthesizeMouseMoveEvent), 790 base::Bind(base::IgnoreResult(&RootWindow::SynthesizeMouseMoveEvent),
783 held_event_factory_.GetWeakPtr())); 791 held_event_factory_.GetWeakPtr()));
784 } 792 }
785 793
786 ui::EventDispatchDetails RootWindow::SynthesizeMouseMoveEvent() { 794 ui::EventDispatchDetails RootWindow::SynthesizeMouseMoveEvent() {
787 DispatchDetails details; 795 DispatchDetails details;
788 if (!synthesize_mouse_move_) 796 if (!synthesize_mouse_move_)
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 break; 949 break;
942 950
943 default: 951 default:
944 NOTREACHED(); 952 NOTREACHED();
945 break; 953 break;
946 } 954 }
947 PreDispatchLocatedEvent(target, event); 955 PreDispatchLocatedEvent(target, event);
948 } 956 }
949 957
950 } // namespace aura 958 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | ui/aura/root_window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698