Page 1 of 1

The mouse's wheel will halt in SimpleOSRBrowser

Posted: Sun Aug 23, 2020 9:39 am
by tad.chen
In the SimpleOSRBrowser Demo, the mouse's wheel sometime will halt after wheel up or down for sometime to scroll the web page. But I still can scroll the web page by the scrollbar at that time.

Re: The mouse's wheel will halt in SimpleOSRBrowser

Posted: Mon Aug 24, 2020 10:41 am
by salvadordf
Hi,

The SimpleOSRBrowser demo intercepts the WM_MOUSEWHEEL message in the TAppEvents.OnMessage event.

This is a simple way to get mouse wheel events but it doesn't work if the user move the mouse outside the form.

If that's what you are experiencing then you can use a low level mouse hook with SetWindowsHookEx and WH_MOUSE_LL to intercept all WM_MOUSEWHEEL messages.

Re: The mouse's wheel will halt in SimpleOSRBrowser

Posted: Tue Aug 25, 2020 12:25 am
by tad.chen
Hi,

It can work even if the user move the mouse outside the form.

But sometime it'll halt, and the web page has no response no matter how the user scroll the mouse wheel.

Until you close the web page and open again, the mouse wheel will work again.

Re: The mouse's wheel will halt in SimpleOSRBrowser

Posted: Tue Aug 25, 2020 8:02 am
by salvadordf
I've seen something like that with some complex or slow websites that cause the renderer to freeze until some resource is loaded.

Can you reproduce that problem with Chrome after you empty the cache?

Re: The mouse's wheel will halt in SimpleOSRBrowser

Posted: Tue Aug 25, 2020 11:33 pm
by tad.chen
Yes, it comes out very often when visit complex websites.

And the problem still exists after I delete all the files and sub directories in the cache directory.

Re: The mouse's wheel will halt in SimpleOSRBrowser

Posted: Fri Aug 28, 2020 1:08 am
by tad.chen
I've solved the problem by cutting down the mouse wheel events. Thank you for your advice.

Re: The mouse's wheel will halt in SimpleOSRBrowser

Posted: Sun Sep 13, 2020 3:18 pm
by salvadordf
I just found some information related to this issue. It seems that this problem can be fixed disabling some CEF features.

Try adding this before the GlobalCEFApp.StartMainProcess call in the DPR file :

Code: Select all

GlobalCEFApp.SmoothScrolling := STATE_DISABLED;
GlobalCEFApp.DisableFeatures := 'TouchpadAndWheelScrollLatching,AsyncWheelEvents';
For reference :
https://bitbucket.org/chromiumembedded/ ... sing-mouse
https://bitbucket.org/chromiumembedded/ ... ional-with

Re: The mouse's wheel will halt in SimpleOSRBrowser

Posted: Tue Oct 13, 2020 3:08 am
by tad.chen
Sorry, I just see your response now. Thank you for your suggestions!

I test it in OSR Demo program according to your advice. It works!

I just use "GlobalCEFApp.SmoothScrolling := STATE_DISABLED".

Maybe my cef4delphi version is a little old, GlobalCEFApp doesn't support DisableFeatures attribute.

But is still work without "GlobalCEFApp.DisableFeatures := 'TouchpadAndWheelScrollLatching,AsyncWheelEvents"