Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

The mouse's wheel will halt in SimpleOSRBrowser

Post Reply
tad.chen
Posts: 104
Joined: Fri Jan 04, 2019 1:39 am

The mouse's wheel will halt in SimpleOSRBrowser

Post 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.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: The mouse's wheel will halt in SimpleOSRBrowser

Post 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.
tad.chen
Posts: 104
Joined: Fri Jan 04, 2019 1:39 am

Re: The mouse's wheel will halt in SimpleOSRBrowser

Post 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.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: The mouse's wheel will halt in SimpleOSRBrowser

Post 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?
tad.chen
Posts: 104
Joined: Fri Jan 04, 2019 1:39 am

Re: The mouse's wheel will halt in SimpleOSRBrowser

Post 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.
tad.chen
Posts: 104
Joined: Fri Jan 04, 2019 1:39 am

Re: The mouse's wheel will halt in SimpleOSRBrowser

Post by tad.chen »

I've solved the problem by cutting down the mouse wheel events. Thank you for your advice.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: The mouse's wheel will halt in SimpleOSRBrowser

Post 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
tad.chen
Posts: 104
Joined: Fri Jan 04, 2019 1:39 am

Re: The mouse's wheel will halt in SimpleOSRBrowser

Post 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"
Post Reply