OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |