nwjs / nw.js

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
https://nwjs.io
MIT License
40.22k stars 3.88k forks source link

Mouse/touch event crash on windows 8 #3652

Closed vdumontier closed 8 years ago

vdumontier commented 9 years ago

I'm experiencing some mistakes with all my multitouch devices on windows 8. Tested on Asus aio22 & MS surface pro 2/3

When i do a lot of touch on the nw window (6 or more fingers quickly and simultaneously), I loose all inputs from mouse/touch.

I can't click in the app (links, buttons, closing cross etc.) The javacript code continue to be executed correctly in background, but the user can't interact with the application.

I have made a little project to test https://github.com/vdumontier/nw-test

with a console "tick message" every second and a message in console on click in the window

maybe someone got same thing.

Thanks

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

robinnorth commented 8 years ago

I am experiencing the same issues with a project using nw.js 0.12.2. I have a hunch that it's caused by this Chromium bug relating to mouse input stopping working after multitouch: https://code.google.com/p/chromium/issues/detail?id=447153

Not sure what the solution is yet at this stage, apart from waiting for Chromium M44 (where a fix has apparently been landed) to be merged into nw.js at some unspecified point in the future.

vdumontier commented 8 years ago

Thank you for your feedback

I made some tests with Chrome. I have the same problem on Chrome 43 and 44. I have tested with Chrome Canary on version 46 and the problem persist. I don't know if the probleme is the same as previous link, but it's not solved :(

robinnorth commented 8 years ago

That's a shame to hear. I'm doing some testing today on a Dell multitouch all-in-one running Windows 8.1, I will report back if I find any useful workarounds.

I am wondering if setting --touch-events=disabled in the chromium-args section of the app manifest will help here (at the cost of not being able to use multitouch gestures in your app).

vdumontier commented 8 years ago

I have already test this flag and the problem persist :(

I have tested on Dell XPS 18 and I have not the issue, I wonder if it's related to the precision of the touch screen

robinnorth commented 8 years ago

It may well be, https://code.google.com/p/chromium/issues/detail?id=316085 seems to imply some hardware-specific touch issues are possible.

So far I've yet to find a decent workaround. My latest approach was to prevent any multitouch events using the following snippet, but allow single touch events (so that touches-as-clicks still work), but I was still able to trigger the issue with a palm swipe!

// Prevent multitouch events
document.addEventListener( 'touchstart', function( e ) {
    var touches = e.touches;
    console.info('touchstart fired', touches.length + ' touches' );
    if ( touches.length > 1 ) {
        console.info( 'Multitouch prevented' );
        e.preventDefault();
    }
} );
vdumontier commented 8 years ago

I made a screen record https://youtu.be/bFIwRzuKRdw

and I submited to https://code.google.com/p/chromium/issues/detail?id=447153#c95

I hope to have a feedback

vdumontier commented 8 years ago

The issue seems to be fixed here : https://code.google.com/p/chromium/issues/detail?id=513969 With this code review : https://codereview.chromium.org/1318653002

I don't know in what version we will can test.

It move ...