Description: Add touchscreen support for other xi2 devices.
Author: Chad MILLER <chad.miller@canonical.com>
Forwarded: yes

Index: dev/ui/events/devices/x11/touch_factory_x11.cc
===================================================================
--- dev.orig/ui/events/devices/x11/touch_factory_x11.cc
+++ dev/ui/events/devices/x11/touch_factory_x11.cc
@@ -108,7 +108,10 @@ void TouchFactory::UpdateDeviceList(XDis
           if (tci->mode == XIDirectTouch) {
             touch_device_lookup_[devinfo.deviceid] = true;
             touch_device_list_[devinfo.deviceid] = true;
-          }
+            VLOG(1) << "addding master device " << devinfo.deviceid << ", it has mode " << tci->mode;
+          } else {
+            VLOG(1) << "ignoring master device " << devinfo.deviceid << " because it has mode " << tci->mode;
+	  }
         }
       }
       pointer_device_lookup_[devinfo.deviceid] = true;
@@ -131,6 +134,9 @@ void TouchFactory::UpdateDeviceList(XDis
               // master device to be touch device.
               touch_device_lookup_[devinfo.attachment] = true;
               touch_device_list_[devinfo.attachment] = true;
+              VLOG(1) << "addding floating/slave device " << devinfo.deviceid << ", it has mode " << tci->mode;
+            } else {
+              VLOG(1) << "ignoring floating/slave device " << devinfo.deviceid << " because it has mode " << tci->mode;
             }
           }
         }
@@ -329,8 +335,12 @@ void TouchFactory::CacheTouchscreenIds(i
                      return touchscreen.id == device_id;
                    });
   // Internal displays will have a vid and pid of 0. Ignore them.
-  if (it != touchscreens.end() && it->vendor_id && it->product_id)
+  if (it != touchscreens.end() && it->vendor_id && it->product_id) {
     touchscreen_ids_.insert(std::make_pair(it->vendor_id, it->product_id));
+    VLOG(1) << "adding device id " << device_id << " to touchscreen list";
+  } else {
+    VLOG(1) << "NOT adding device id " << device_id << " to touchscreen list because it as a vid or pid zero";
+  }
 }
 
 }  // namespace ui
