Skip to content

X11 --touch-devices switch #978

Closed
Closed

Description

@GeorgS

My atom-shell app needs to run on a specific linux device which has a touch-panel.
Out of the box some things like dragging a range input don't work with atom-shell (as well as with chromium). After some testing I figured out that if I start chromium with

chromium-browser --touch-devices=TOUCHSCREEN_ID --touch-events

the touchscreen gets recognised and the range sliders work.

I've managed to add the --touch-events switch to the atom-shell code as it's part of the WebRuntimeFeatures with

blink:WebRuntimeFeatures::enableTouch(bool);

Now I can enable it through app.commandLine.appendSwitch('touch', 'true');.

But I have no idea how to implement the --touch-devices switch as I have no experience with the atom-shell code nor with the chromium code.
If someone has a hint or idea how to add this I would appreciate it a lot.

Activity

  1. anaisbetts commented on Jan 6, 2015

    @anaisbetts
    Contributor

    Is there any reason to just not enable it all the time?

  2. zcbenz commented on Jan 6, 2015

    @zcbenz
    Contributor

    Are you using the latest atom-shell? I believe code related to --touch-events and --touch-devices is already in atom-shell.

    Can you try appending --touch-events=invalid in command line and see if there is a Invalid --touch-events option: invalid error printed? If it does not then you are using an old atom-shell that doesn't support this switch.

    Is there any reason to just not enable it all the time?

    I think it will convert all mouse events into touch events.

  3. GeorgS commented on Jan 7, 2015

    @GeorgS
    Author

    Okay - didn't know this is already implemented.
    I've tested this on 0.20.4 now - yes, --touch-events does work. I get Invalid --touch-events option: invalid. But when I execute it with --touch-devices=invalid I don't get an error message.

    The function for --touch-devices can be found here https://github.com/scheib/chromium/blob/master/ui/events/x/touch_factory_x11.cc#L56.

  4. GeorgS commented on Jan 7, 2015

    @GeorgS
    Author

    I've now tested this on the linux device with the touch-panel, both flags work 👍.
    Sorry for not checking this first - thanks!

  5. elkwood commented on Feb 13, 2015

    @elkwood

    I'm sorry to bring up an old issue but I'm having trouble with this.
    Ubuntu 14.04 Atom v0.21.2

    app.commandLine.appendSwitch('touch-devices', 'invalid') ;
    // No warning printed
    app.commandLine.appendSwitch('touch-events', 'invalid')
    // Invalid --touch-events option: invalid
    
  6. GeorgS commented on Feb 14, 2015

    @GeorgS
    Author

    @mcdermed you need to append --touch-events and --touch-devices=X to the atom executable.
    ./atom --touch-events --touch-devices=ID PATH_TO_APP works for me on ubuntu 12.04.

    I haven't tried if it works with the app.commandLine.appendSwitch though.

  7. elkwood commented on Feb 25, 2015

    @elkwood

    Thanks for the response @GeorgS. I'm just now getting around to testing this again and it seems like those flags aren't having any effect on touch events for me. I've set --touch-devices=X to multiple different values and I see no difference in touch events being triggered in the browser.

    google-chrome --touch-events --touch-devices=8 www.google.com
    // Touch events work
    ./atom --touch-events --touch-devices=8 app_path
    // touch events work
    ./atom --touch-events --touch-devices=15 app_path
    //touch events work
    

    Perhaps I misunderstand how this flag works but I interpret it as only the device id specified will be used for touch input. If chrome can't use the touch device does it fallback to finding it itself?
    I'm using this flag to try to resolve this chrome bug https://code.google.com/p/chromium/issues/detail?id=439914

  8. am-kantox commented on Apr 14, 2015

    @am-kantox

    As it is described in details at atom/atom#6306, atom editor since version 0.189.0 suffers from a Chrome41 bug with touch screen in Linux@VirtualBox environment. I have tried:

    • passing option(s) --touch-devices=123 and/or --touch-events=invalid to atom command line directly;
    • modifying /usr/bin/atom to pass the options above;
    • patching source code with app.commandLine.appendSwitch '--touch-events=123' and rebuilding the editor from the scratch.

    Nothing helped.

  9. jadbox commented on Jun 22, 2015

    @jadbox

    I'm having the same issue! Very annoying ><

  10. mgcrea commented on Sep 14, 2015

    @mgcrea

    Can confirm this is fixed with latest electron (based on v45).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions