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.

How to avoid twinkle in TabbedOSRBrowser

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

How to avoid twinkle in TabbedOSRBrowser

Post by tad.chen »

Hi,

I find a problem in TabbedOSRBrowser. When I open several webpages in different tabs, I change window state from normal to Maximized and come back to normal soon, then I change to another tab and find the webpage twinkles, the webpage in another tab becomes larger and returns to normal size quickly.

It seams that browser in other tabs remember the size changing event, and the webpage twinkle is not friendly for user. But commercial browser hasn't this problem.

How to fix it?
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to avoid twinkle in TabbedOSRBrowser

Post by salvadordf »

Hi,

That demo stops painting all the browsers in unselected tabs to improve the performance.

The TMainForm.UpdateBrowsersVisibility procedure is used to call ShowBrowser or HideBrowser depending on the tab selection status.

If the application resizes while a browser is hidden then the browser size is not updated. When the user selects a new tab then the TMainForm.UpdateBrowsersVisibility procedure shows the browser and its size is updated. This is why the browser flickers when selecting new tabs.

There are several ways to avoid this :
  • The easy way : Don't hide any browser and disable all the TMainForm.UpdateBrowsersVisibility calls. The performance will be worse.
  • The best way : Use the same TBufferPanel component for all the browsers. You would need to remove all the TBufferPanel components from the frames and use a new TBufferPanel component outside the frames for all the browsers. This solution requires many code changes but the performance will be the same and the flicker issue should be fixed.
tad.chen
Posts: 104
Joined: Fri Jan 04, 2019 1:39 am

Re: How to avoid twinkle in TabbedOSRBrowser

Post by tad.chen »

Thank you for your suggestion.

But I still have some questions. Why BriskBard has no this problem? I think it's based on DCEF4 too. Or only OSR mode has this problem?

It seams that OSR browser can remember two resizing events in hidden status. During Window is from normal to Maximized and come back to normal, there are two resizing events. I can see two resizing actions in the OSR browser when it becomes visible again.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to avoid twinkle in TabbedOSRBrowser

Post by salvadordf »

BriskBard use CEF browsers in normal mode and this issue only affects the TabbedOSRBrowser demo because it uses browsers in OSR mode with frames.

Use the suggested solutions in your application in order to fix this issue.
tad.chen
Posts: 104
Joined: Fri Jan 04, 2019 1:39 am

Re: How to avoid twinkle in TabbedOSRBrowser

Post by tad.chen »

OK, thanks!
Post Reply