Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ozone/platform/drm/host/drm_window_host.h" | 5 #include "ui/ozone/platform/drm/host/drm_window_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "ui/events/devices/device_data_manager.h" | 8 #include "ui/events/devices/device_data_manager.h" |
| 9 #include "ui/events/event.h" | 9 #include "ui/events/event.h" |
| 10 #include "ui/events/ozone/evdev/event_factory_evdev.h" | 10 #include "ui/events/ozone/evdev/event_factory_evdev.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 bool DrmWindowHost::CanDispatchEvent(const PlatformEvent& ne) { | 121 bool DrmWindowHost::CanDispatchEvent(const PlatformEvent& ne) { |
| 122 DCHECK(ne); | 122 DCHECK(ne); |
| 123 Event* event = static_cast<Event*>(ne); | 123 Event* event = static_cast<Event*>(ne); |
| 124 | 124 |
| 125 // If there is a grab, capture events here. | 125 // If there is a grab, capture events here. |
| 126 gfx::AcceleratedWidget grabber = window_manager_->event_grabber(); | 126 gfx::AcceleratedWidget grabber = window_manager_->event_grabber(); |
| 127 if (grabber != gfx::kNullAcceleratedWidget) | 127 if (grabber != gfx::kNullAcceleratedWidget) |
| 128 return grabber == widget_; | 128 return grabber == widget_; |
| 129 | 129 |
| 130 if (event->IsTouchEvent()) { | 130 if (event->IsTouchEvent()) { |
| 131 #ifdef FORCE_DISPATCH_TOUCH_EVENTS | |
| 132 // TODO(lanechr): This bypasses checks that ensure that touch events | |
| 133 // are dispatched to the right display. The "right display" is defined as | |
| 134 // "the display associated with the touch device." Displays are associated | |
| 135 // with touch devices through DeviceDataManager::UpdateTouchInfoForDisplay, | |
|
jamesr
2015/12/01 23:25:21
wouldn't we call this from https://github.com/domo
| |
| 136 // which (as of today) is never called. | |
| 137 // | |
| 138 // I'm not sure yet how to best determine touchscreen/display association, | |
| 139 // but FNL currently only supports devices with one touch screen. So for | |
| 140 // now, always dispatch touch events on FNL devices. | |
| 141 return true; | |
| 142 #endif | |
| 131 // Dispatch the event if it is from the touchscreen associated with the | 143 // Dispatch the event if it is from the touchscreen associated with the |
| 132 // DrmWindowHost. We cannot check the event's location because if the | 144 // DrmWindowHost. We cannot check the event's location because if the |
| 133 // touchscreen has a bezel, touches in the bezel have a location outside of | 145 // touchscreen has a bezel, touches in the bezel have a location outside of |
| 134 // |bounds_|. | 146 // |bounds_|. |
| 135 int64_t display_id = | 147 int64_t display_id = |
| 136 DeviceDataManager::GetInstance()->GetTargetDisplayForTouchDevice( | 148 DeviceDataManager::GetInstance()->GetTargetDisplayForTouchDevice( |
| 137 event->source_device_id()); | 149 event->source_device_id()); |
| 138 | 150 |
| 139 if (display_id == gfx::Display::kInvalidDisplayID) | 151 if (display_id == gfx::Display::kInvalidDisplayID) |
| 140 return false; | 152 return false; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 186 } | 198 } |
| 187 | 199 |
| 188 void DrmWindowHost::SendBoundsChange() { | 200 void DrmWindowHost::SendBoundsChange() { |
| 189 // Update the cursor before the window so that the cursor stays within the | 201 // Update the cursor before the window so that the cursor stays within the |
| 190 // window bounds when the window size shrinks. | 202 // window bounds when the window size shrinks. |
| 191 cursor_->CommitBoundsChange(widget_, bounds_, GetCursorConfinedBounds()); | 203 cursor_->CommitBoundsChange(widget_, bounds_, GetCursorConfinedBounds()); |
| 192 sender_->WindowBoundsChanged(widget_, bounds_); | 204 sender_->WindowBoundsChanged(widget_, bounds_); |
| 193 } | 205 } |
| 194 | 206 |
| 195 } // namespace ui | 207 } // namespace ui |
| OLD | NEW |