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

Unified Diff: ui/display/chromeos/touchscreen_delegate_impl.cc

Issue 394063004: Associate internal touchscreen to internal display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove using external script is_touchscreen_internal Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
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..dc60e3fb24604d7f3b1d5c7ba3774ff42f16454b 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_touchscreen = -1;
+ for (size_t i = 0; i < devices.size(); ++i) {
+ if (devices[i].is_internal) {
+ internal_touchscreen = i;
+ break;
+ }
+ }
+
+ DisplayConfigurator::DisplayState* internal_state = NULL;
+ 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_state = state;
+ break;
+ }
+ }
+
+ if (internal_state && internal_touchscreen >= 0) {
+ internal_state->touch_device_id = devices[internal_touchscreen].id;
+ VLOG(2) << "Found internal touchscreen for internal display "
+ << internal_state->display->display_id() << " touch_device_id "
+ << internal_state->touch_device_id << " size "
+ << devices[internal_touchscreen].size.ToString();
+ }
+
for (size_t i = 0; i < devices.size(); ++i) {
+ if (internal_state &&
+ internal_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];

Powered by Google App Engine
This is Rietveld 408576698