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

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

Issue 10388198: ash: Add the SYNTHETIC flag to mouse-events generated from gestures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates-test Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/shared/root_window_event_filter_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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 737
738 default: 738 default:
739 break; 739 break;
740 } 740 }
741 if (types) { 741 if (types) {
742 gfx::Point point_in_root(event->location()); 742 gfx::Point point_in_root(event->location());
743 Window::ConvertPointToWindow(target, this, &point_in_root); 743 Window::ConvertPointToWindow(target, this, &point_in_root);
744 // Move the mouse to the new location. 744 // Move the mouse to the new location.
745 if (generate_move && point_in_root != last_mouse_location_) { 745 if (generate_move && point_in_root != last_mouse_location_) {
746 MouseEvent synth(ui::ET_MOUSE_MOVED, point_in_root, 746 MouseEvent synth(ui::ET_MOUSE_MOVED, point_in_root,
747 event->root_location(), event->flags()); 747 event->root_location(),
748 event->flags() | ui::EF_IS_SYNTHESIZED);
sky 2012/05/18 19:53:29 We want ET_FROM_TOUCH here.
sadrul 2012/05/18 19:58:45 In addition, right? (instead of instead of)?
sadrul 2012/05/18 20:02:03 Done.
748 if (DispatchMouseEventToTarget(&synth, target)) 749 if (DispatchMouseEventToTarget(&synth, target))
749 status = ui::GESTURE_STATUS_SYNTH_MOUSE; 750 status = ui::GESTURE_STATUS_SYNTH_MOUSE;
750 } 751 }
751 for (const ui::EventType* type = types; *type != ui::ET_UNKNOWN; 752 for (const ui::EventType* type = types; *type != ui::ET_UNKNOWN;
752 ++type) { 753 ++type) {
753 int flags = event->flags(); 754 int flags = event->flags() | ui::EF_IS_SYNTHESIZED;
754 if (event->type() == ui::ET_GESTURE_DOUBLE_TAP && 755 if (event->type() == ui::ET_GESTURE_DOUBLE_TAP &&
755 *type == ui::ET_MOUSE_PRESSED) 756 *type == ui::ET_MOUSE_PRESSED)
756 flags |= ui::EF_IS_DOUBLE_CLICK; 757 flags |= ui::EF_IS_DOUBLE_CLICK;
757 758
758 // It is necessary to set this explicitly when using XI2.2. When using 759 // It is necessary to set this explicitly when using XI2.2. When using
759 // XI < 2.2, this is always set anyway. 760 // XI < 2.2, this is always set anyway.
760 flags |= ui::EF_LEFT_MOUSE_BUTTON; 761 flags |= ui::EF_LEFT_MOUSE_BUTTON;
761 762
762 // DispatchMouseEventToTarget() expects coordinates in root, it'll 763 // DispatchMouseEventToTarget() expects coordinates in root, it'll
763 // convert back to |target|. 764 // convert back to |target|.
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 void RootWindow::UnlockCompositor() { 1018 void RootWindow::UnlockCompositor() {
1018 DCHECK(compositor_lock_); 1019 DCHECK(compositor_lock_);
1019 compositor_lock_ = NULL; 1020 compositor_lock_ = NULL;
1020 if (draw_on_compositor_unlock_) { 1021 if (draw_on_compositor_unlock_) {
1021 draw_on_compositor_unlock_ = false; 1022 draw_on_compositor_unlock_ = false;
1022 ScheduleDraw(); 1023 ScheduleDraw();
1023 } 1024 }
1024 } 1025 }
1025 1026
1026 } // namespace aura 1027 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/shared/root_window_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698