0) Since the Pull request was out of date, I have rebased it to the latest master.
1) Sample client usage for OSX. Since there is no touch screen on OSX devices, the sample usage simulates touch screen by mapping touch events on TrackPad to Touch Events on Screen (and may be slightly flaky hence).To ensure it does not interfere with other Trackpad events, this mapping is only enabled if touch-events=enabled commandline is passed and caps lock key is on.
2) Sample Client Usage Win: Sample client usage for Win is based on WM_TOUCH (and not WM_POINTER) since WM_POINTER is not available on Win7, and a lot of clients will likely require Win7 support.
The unit tests are working on all platforms and the sample simulating Touch by mapping Trackpad seems to work reasonably well. Please review. @Tammo Hinrichs It'll be great if you can help with adding Win sample usage to close this long standing issue.
@Tammo Hinrichs I have added Windows sample usage also. The Windows Sample client usage for is based on WM_TOUCH (and not WM_POINTER) since WM_POINTER is not available on Win7, and we (and a lot of other clients likely) still require Win7 support.
@Tammo Hinrichs [again overstepping the boundaries but :)] Please let me know if I can help further with rebasing these changes and keeping them in Sync with the master to ease with merging to Trunk. (While my other PRs were under review I had automated, rebasing, building and validating my PRs on Win/Mac.) Since we are now using this Touch implementation, I am doing the same with this PR by forking this as a local PR, with original commits rebased to master and sample usage + cleanup)
Thanks to all. As for Windows example while it miss WM_POINTER usage, i suggest just to include comment about in sample code, otherwise followers miss this point. (Argues about Windows 7 is correct, but on modern systems WM_POINTER support should be mandatory choice. )
Speaking of overstepping boundaries and now becoming the guy who demands stuff: Could you check John's comment on CefRenderWidgetHostViewOSR::OnGestureEvent() below and add the three lines of code he suggested?
@Nishant Kaushik. I have complie CEF 3071 with changes from PR 104 and test on Win10. cefclient.exe --off-screen-rendering-enabled --touch-events-enabled You see, the problem is that though touch-scroll works just fine but if there is some texting and other objects then it become selected while I try to touch-scroll the page. Screen captupe link https://yadi.sk/i/fm-LggO-3KooNf Problem in the CefClient.
@Nishant Kaushik, but if i disable all mouse Events in cefclient (osr_window_win.cc: // self->OnMouseEvent(message, wParam, lParam);) then it works just fine!!! It seems Touch events generate additional Mouse events.
@Alexey Makarov Great catch! and thanks. Windows indeed sends synthesised mouse events from Touch events. I have updated the client usage to ignore mouse events coming from Touch (like we do in chromium eg. IsMouseEventFromTouch).
Hello everyone i follow this project for long time and I want to try it because is extremely charming but i tried to download the project and build it and I obtain a lot of error and I don't know how to solve it.
I have also tried to start from a standard build and follow the instruction from the guide but i obtain an error during the extracting.
So is there anyone that can can send me the build project with .sln file ?
Thanks to much
I have found the problem and make my own resolution (maybe not the best...)
My touch problem was located in the render_widget_host_view_osr.cc file, in the CefRenderWidgetHostViewOSR::TranslateTouchEvent method
Symptom : When you totally disable mouse events, you cannot pinch to zoom in maps.google.fr. You can invoke the devtool on this website and launch a monitorEvents(document) on the console. You will see (on a fully touch action) some mouse events.
Problem : In the given method, we call CreateWebTouchEventFromMotionEvent but this method does not fill properly the Id so that when we call MarkUnchangedTouchPointsAsStationary, we mark ALL events as stationary (even the last move event sent).
Solution : I just comment the call of MarkUnchangedTouchPointsAsStationary. This is not the best but i have now a fully functional solution with native touch/pinch to zoom.
(CreateWebTouchEventFromMotionEvent is actually implemented is chromium/src/ui/events/blink/blink_event_util.cc and is the same code that used by chromium and in non osr mode and that too is working as expected. So the issue likely lies elsewhere.)
Pinch to zoom on maps.google.fr seems to be working fine in sample CefClient (please make sure you pass touch-events=enabled command line flag). Can you please confirm if this is working in sample Cef client.
@Nishant Kaushik There is an error OnTouchEventAck has wrong arguments in cef\libcef\browser\osr\render_widget_host_view_osr.cc
gesture_provider_.OnTouchEventAck(touch.event.unique_touch_event_id, event_consumed, false); when i try to complile PR104 on branch 3107 with latest changes.
It depends on the branch?
@Nishant Kaushik i found a small bug in cefclient. If cefclient starts on touch monitor without touch-events=enabled flag no events MOUSEFROMTOUCH happen and there is no navigation control etc. May be it worth analyzing this flag in the function IsMouseEventFromTouch()?
Thanks Marshall. I have applied the patches and fixed the build. Also tests seem to be successful in Release build on both Win and Mac. I am building the debug build and will fix or update about Test failure.
@Marshall Greenblatt, I verified the tests on Win10/Win 7 machines and OSX on two different machines, for both Debug and Release configurations 5 runs for each instances. I did not observe any test failure or time out.
Can you please confirm if you are seeing the failure still on latest PR? (After I applied the changes you suggested and latest rebase).
Also can you please have 2-3 runs of test in case of failure to narrow down if the failure is real for you?
@Nishant Kaushik, the question is a bit aside from the topic.
I need to determine the moment when the node definite types (element) touched (clicked) but if touch (click) on the same element, the node has not changed.
Cef has an event NodeСhanged. In the case of a Mouse Click, NodeСhanged occurs before the event MouseUp. In MouseUp i can determine clicked Element(Node) and compare with previous node.
In the case of Touch, NodeСhanged occurs after all events. In touch/click events i dont know touched Element.
How can i recieve the Node before touchUp event, if it`s even possible?
Hello, thanks for this PR it's really helping me putting things in my app forward.
I have some feedback after testing this today on a Linux x64 host. I realized that sometimes the browser doesn't respond to touch events anymore (mouse works fine).
I found that this was caused by a touch sequence starting but not ending, so for example when I use long touch to trigger a context menu right under the cursor the browserhost doesn't receive a TET_RELEASED or TET_CANCELLED.
Right now I, as application programmer, am forced to internally track all touches (which this PR already does) and end them synthetically when I detect a focus change for example. It would be a nice gimmick to have a function to cancel any pending touches.
Maybe it would be a good idea to automatically cancel all pending touch sequences on different occasions:
host->SendFocusEvent(FALSE) - we lost focus. No need for left over touch sequences, don't know if TET_RELEASED or TET_CANCELLED in this case.
OnLoadStarted? I don't know if that's really a good idea we left the page, what are pending touches good for? But OnLoadStarted doesn't necessarily mean page change.
A timer? Not very elegant but who keeps a touch going for more than 30s for example?
I can write a patch after some considerations, what are your thoughts?
I've been playing with this pull request on 64-bit Linux (CentOS) and noticed some odd behavior.
I applied this patch to Release Branch 3239 and tested it with the site https://frames-per-second.appspot.com in CefClient.
Without offscreen rendering I'm able to render and paint at 60fps (Screenshot). With off-screen-rendering it is only able to paint at 30fps (Screenshot).
When I apply this patch performance drops further and I can only render at 30fps and it struggled to paint at 30fps. (Screenshot)