Index: ui/display/chromeos/touchscreen_delegate_impl.cc |
diff --git a/ui/display/chromeos/touchscreen_delegate_impl.cc b/ui/display/chromeos/touchscreen_delegate_impl.cc |
index 5311a828369183a2c9cf8dfebafffb89cd67ac7f..7721a443428a0c0a067ada32419c0e914273ea2b 100644 |
--- a/ui/display/chromeos/touchscreen_delegate_impl.cc |
+++ b/ui/display/chromeos/touchscreen_delegate_impl.cc |
@@ -23,7 +23,38 @@ void TouchscreenDelegateImpl::AssociateTouchscreens( |
std::vector<DisplayConfigurator::DisplayState>* displays) { |
std::set<int> no_match_touchscreen; |
std::vector<TouchscreenDevice> devices = touch_device_manager_->GetDevices(); |
+ |
+ int internal_ts = -1; |
Daniel Erat
2014/07/16 02:59:46
s/ts/touchscreen/
Yufeng Shen (Slow to review)
2014/07/16 20:20:27
Done.
|
+ for (size_t i = 0; i < devices.size(); ++i) { |
+ if (devices[i].is_internal) { |
+ internal_ts = i; |
+ break; |
+ } |
+ } |
+ |
+ DisplayConfigurator::DisplayState* internal_dpy_state = NULL; |
Daniel Erat
2014/07/16 02:59:46
s/dpy/display/, or just name this |internal_state|
Yufeng Shen (Slow to review)
2014/07/16 20:20:27
Done.
|
+ for (size_t i = 0; i < displays->size(); ++i) { |
+ DisplayConfigurator::DisplayState* state = &(*displays)[i]; |
+ if (state->display->type() == DISPLAY_CONNECTION_TYPE_INTERNAL && |
+ state->display->native_mode() && |
+ state->touch_device_id == 0) { |
+ internal_dpy_state = state; |
+ break; |
+ } |
+ } |
+ |
+ if (internal_dpy_state && internal_ts >= 0) { |
+ internal_dpy_state->touch_device_id = devices[internal_ts].id; |
+ VLOG(2) << "Found internal touchscreen for internal display " |
+ << internal_dpy_state->display->display_id() << " touch_device_id " |
+ << internal_dpy_state->touch_device_id << " size " |
+ << devices[internal_ts].size.ToString(); |
+ } |
+ |
for (size_t i = 0; i < devices.size(); ++i) { |
+ if (internal_dpy_state && |
+ internal_dpy_state->touch_device_id == devices[i].id) |
+ continue; |
bool found_mapping = false; |
for (size_t j = 0; j < displays->size(); ++j) { |
DisplayConfigurator::DisplayState* state = &(*displays)[j]; |