Chrome + Touchscreen + Unity (14.04)

All we need is an easy explanation of the problem, so here it is.

I’ve got a Dell 14R with touchscreen with Ubuntu 14.04.
When I start Google Chrome by clicking the launcher with the TouchPad or with the Super+ combination, touch support in Chrome doesn’t work. When I touch some element, it only gets focus, but doesn’t activate the element (button, field, etc). And touch gestures don’t work.
In the other hand, if I start Chrome by touching the launcher button, touch scroll works in Chrome, even flicking to left does back to the previous page, etc.
It doesn’t makes sense to me, but is always like this, even across reboots.
Anyone can confirm this? Any idea on how to fix?

How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

That problem could be solved for me with Chrome’s --touch-devices command line parameter.

Determine X’s input device id in a console by

xinput list

leading to

google-chrome --touch-devices=10

on my system.

To make Chrome always use this CLI flag, see:
How to set CLI flags for Google Chrome?

Method 2

UPDATED Answer:

  1. Edit ~/.profile and add the following to the end of the file:

    export CHROMIUM_USER_FLAGS="--touch-devices=`echo $(xinput list | grep 'Virtual core pointer' | awk 'match(\$0, /id=/){print substr($0, RSTART+3, RLENGTH-1)}')` --touch-events=enabled --enable-pinch"
    
  2. Log out and then log back in.

  3. Start Google Chrome as normal

TIP: You may have to change “Virtual core pointer” string in the command above to the name of your “master pointer” touchscreen input device in the command above. Just use xinput command to find the name of your device.

NOTE: I am on Ubuntu 15.04 using /usr/bin/google-chrome-stable

OLD Answer:

I have Ubuntu 14.14. This worked for me:

  1. Make a shell script to start Google Chrome browser called start-chrome.sh.

    I put mine in: /usr/local/bin/start-chrome.sh

    Add the following to the file:

    #!/bin/bash
    /usr/bin/google-chrome-stable --touch-devices=$(xinput list | grep Touchscreen | awk 'match(\$0, /id=/){print substr($0, RSTART+3, RLENGTH)}') --touch-events=enabled --enable-pinch
    

    Basically, I am using the xinput list command and greping for “Touchscreen” and finding it’s corresponding id. You may have to change “Touchscreen” to the name of your touchscreen input device in the command above.

  2. Edit /usr/share/applications/google-chrome.desktop. Find all occurrences of Exec=google-chrome-stable and replace it with Exec=start-chrome.sh

NOTE: I believe this solution will work until you update Google Chrome (via apt-get upgrade) and the google-chrome.desktop file is overwritten. You will need to follow step 2 above to fix it.

Method 3

You could try enabling touch events under Chrome flags:

  1. Navigate to chrome://flags/#touch-events and set it to enabled
  2. Restart Chrome

Source:

https://github.com/EightMedia/hammer.js/wiki/How-to-fix-Chrome-35–and-IE10–scrolling-(touch-action)

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply