add scroll function

Think CEF could benefit from a new feature or capability? Discuss CEF feature requests here.

add scroll function

Postby AndyB » Wed May 31, 2017 3:58 pm

I have implemented touch scroll for WPF version of CefSharp.
My first attempt was to use SendMouseWheelEvent, but this stops working at some point after navigation, click on buttons, select item in dropdown....
I generally use now javascript window.scrollBy() function. Mostly it works fine, but with some websites not, for ex.: https://www13.state.nj.us/DataMiner
The scrollbar is displayed and i can manually scroll, also touch scroll works in cefclient.exe... but scrollBy has no effect, SendMouseWheelEvent also does not work.
The scrollBy function does not work in IE, FireFox and Chrome for this sample website. I guess they have some javascript hack or strange CSS styles which makes the srollBy function not working.

scrollBy does not work at all when a PDF is displayed, SendMouseWheelEvent scrolls the PDF down, but not up.

It would be great if you can add a scroll method to CEF.
AndyB
Techie
 
Posts: 39
Joined: Sun Apr 16, 2017 3:00 pm

Re: add scroll function

Postby magreenblatt » Wed May 31, 2017 4:30 pm

Have you tried sending windows scroll events to the browser window handle? E.g WM_VSCROLL.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: add scroll function

Postby amaitland » Wed May 31, 2017 5:19 pm

There is already an open PR that will provide touch scrolling functions.

https://bitbucket.org/chromiumembedded/ ... quests/104
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: add scroll function

Postby AndyB » Thu Jun 01, 2017 2:25 pm

magreenblatt: Thank you for your quick response and your hint!

The WPF control uses the offscreen version.
Sending WM_VSCROLL does not work. I can send messages only to the main window, not to controls. Also, i think i cannot specify pixels for WM_VSCROLL.
And the WM_VSCROLL would need to get processed by the CefSharp WPF control.

I think i solved my problem with the sample site.
I have set 0 as X and Y mouse position for the SendMouseWheelEvent. This works on most sites, but for some reason i need to set for ex 300,300 to make it working with the sample site.

But now i still have the problem that SendMouseWheelEvent stops working at some point after navigating, clicking, scrolling around.
It happens on a Microsoft Surface ProTablet. Maybe on any Windows Tablet, maybe only on tablets with High DPI.
amaitland: Can you check this when i send you a sample VB.NET project and tell you how to re-produce the issue?

I found a few posts about Touch support for WPF/Offscreen from 2014 and later, most with comments "just use WinForms".
I don't wanted to wait for "maybe works some day".
I tried WinForms with WindowsFormsHost, but this worked not in my app, my app was freezing very often.
AndyB
Techie
 
Posts: 39
Joined: Sun Apr 16, 2017 3:00 pm

Re: add scroll function

Postby rdi » Sun Aug 19, 2018 10:43 pm

I updated CEF in my application and encountered the same issue: after navigating across a couple pages, the scroll just stops working. Pressing Page Up/Down on the keyboard or scrolling with the scroll bars works. Only:

Code: Select all
browser->GetHost()->SendMouseWheelEvent(MOUSE_EVENT_SCROLL, scrollX, scrollY);


stops. Any suggestions welcome.
rdi
Newbie
 
Posts: 2
Joined: Sun Aug 19, 2018 10:39 pm

Re: add scroll function

Postby amaitland » Sun Aug 19, 2018 10:54 pm

Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: add scroll function

Postby rdi » Sun Aug 19, 2018 11:38 pm

Thanks.
rdi
Newbie
 
Posts: 2
Joined: Sun Aug 19, 2018 10:39 pm


Return to Feature Request Forum

Who is online

Users browsing this forum: No registered users and 20 guests