Not working on touch screen #237
Comments
Touch screen/multitouch is not a feature that Chromely supports out of the box. I believe it is configurable using CEF command line options. These links may help: So this may help: var config = DefaultConfiguration.CreateForRuntimePlatform();
config.CommandLineArgs["touch-events"] = "enabled"; I do not have a touch screen device, so cannot really prove this. If this does not work then, NativeHost may need to be customized - https://docs.microsoft.com/en-us/windows/win32/wintouch/windows-touch-gestures-overview Keep us posted. |
@mattkol Thank you for the feedback.
What helped, interestingly, was to disable kiosk mode; with |
Could it have anything to do with this? Chromely/src/Chromely.CefGlue/BrowserWindow/HostBase.cs Lines 201 to 205 in e8d7b17
Chromely/src/Chromely/Native/WinAPI/WinAPIHost.cs Lines 511 to 514 in 4f9943a
|
@IlyaSemenov it is possible. It was added as part of a PR fix for frameless at the time - #84 It may not be needed anymore. It is being cleaned up in current version 5.1, but may still be needed as it is not possible for us to test all scenarios at our end. So with some feed backs we can determine whether we still need it or not. |
@mattkol I don't think you've actually released version 5.1, have you? |
DoMessageLoopWork would normally be run on a timer and be called on the UI thread 30/60 times per second. With an additional say 10 calls before CefShutdown is called to finish processing any messages. Too many or too few calls to CefDoMessageLoopWork and performance will suffer. cztomczak/cefpython#245 has some reference links. |
@amaitland thanks for your input. Looks like the On Idle approach was abandoned by CefSharp? |
@mattkol Abandoned long ago, example was updated like 4 years ago 😄 calling CefDoMessageLoopWork to infrequently is a problem. No guarantee when idle will be called. |
I refactored my app to use Chromely 5.1.83-pre01 and here are my observations so far:
This is on Windows 7 32 bit. |
@amaitland got it! Thanks. |
Which of the base application classes are you using? |
ChromelyBasicApp, let me try on the other. |
Anyhow, the original problem is resolved, thank you. I believe I can live with |
Thanks for looking into it. So when you say Fullscreen= true works just fine, you mean the touch screen now works? With v5.1 or v5.0? Also reason you are not seeing anything is this:
That should have been removed too. |
Yes, touch screen works in 5.1 (both taps as clicks, and drag to scroll HTML containers). |
It might be worth a a look at https://magpcss.org/ceforum/apidocs3/projects/(default)/(_globals).html#CefRunMessageLoop() and have CEF run the message loop. On Windows and Linux you can use the CEF Views implementation to create frameless windows etc. No mac osx support though. https://bitbucket.org/chromiumembedded/cef/issues/1749 |
@amaitland running Cef-only message loop on windows is something I have toyed with in the past, but I could not find enough info to see if it is preferred and what windows messaging functionalities may be impacted. But definitely something we could provide as an option. Thanks. |
@mattkol CefRunMessageLoop is available on win/Linux/mac and is the default for both cefclient and cefsimple sample applications. Cefsimple has a very minimal example see https://github.com/chromiumembedded/cef/tree/master/tests/cefsimple (CEF GitHub mirror, much easier to navigate than bitbucket). From memory the shutdown steps have to be done in the correct order or you'll have problems, nothing major though. |
@amaitland I just tried swapping Windows messaging with CefRunMessageLoop - it crashed the app. I'll have to find time to look at it a lot deeper. I looked at this at the beginning but I could not remember much of my findings now. I am sure it will work, whether it will impact other features, is what I cannot say. We will see. Thanks. |
What exactly did you try?
|
@amaitland called CefRunMessageLoop. I think I missed setting Multithreadedmessageloop to false. I need to find time to look at this closer. Will keep you posted. |
…for Multithreadedmessageloop (Windows ONLY).
@amaitland seems to work great without any impact - df44870. I am making it configurable for now, until we have some feedbacks. Usage: Either of these 2 options will turn it on - using CefRunMessageLoop (Windows ONLY)
or
I will add a wiki page soon. Thanks for your guide. |
…ssageLoop - for Multithreadedmessageloop (Windows ONLY).
I am running a full screen Chromely app on a Windows 7 host with a touch screen. For some reason, taps on the screen are not sending any events into the web app running in Chromely (there are no
click
, nomousedown
and notouchstart
events emitted). What is even worse, very rarely, like after I tap 100 times, it suddenly passes a few taps as clicks, and then stops working again (I didn't find any pattern, and it's hard to reproduce).On the same host, when I start desktop Chrome or other desktop apps, touch works normally, I can click buttons, etc.
Clicks with mouse work normally on that Chromely app.
Any advice on how to debug this? I have not a slightest idea on which level could clicks processed incorrectly. .net core? cefglue? chromely itself?
UPDATE: to make it clear: for starters, I don't really need the actual 'touch' events (touchstart/etc.), I only need normal clicks to works. Every other desktop app works with the touch screen (taps are registered as clicks), and I highly doubt they all have special built-in support for touch events.
It seems to be the other way around, if the app doesn't even try to handle touches, it works normally using some kind of system wide fallback. And Chromely apparently somehow 'enables' touch support - which apparently disables native tap-to-click conversion - but doesn't actually handle them.
The text was updated successfully, but these errors were encountered: