FM 11 Portal Flickering Explained
Background: For the past two weeks I've been studying Portal Refresh Flashing in FM11. I was one of the first ones to upgrade following the version's official release and I didn't have the benefit of some of the forum posts before making my purchase decision. For the record, I have 4 years experience with FileMaker as an application developer and 20 years before that as a graphical interface designer.
Demo File: To clearly test and demonstrate the effects in a variety of portal/layout combinations, I built a sample application. Since I've found no way to post files to this site, it is currently available at: Sample File
This situation is disheartening. Although FileMaker resolved many of the flickering issues on Windows (that have plagued all prior versions), they induced flashing in portal refreshes that is worse than anything in previous versions. <see here courtesy of SWS> Either they didn't fully test FM 11 (very bad) or they couldn't figure out what was causing it and decided to release it anyway (pretty bad, also). If they did so, did they seriously think this was acceptable?
But there is hope. It's pretty clear where the problem lies -- and it's fixable ... by FileMaker, Inc. Here's the executive summary:
The portal scroll refresh logic is too simplistic. It attempts to fully refresh all the underlying colors/graphics on each portal scroll movement -- sort of a "better safe than sorry" approach. The refresh sequence can be observed from the On Graphic layout of my sample file. Note how the underlying graphic panels flash ever so briefly into view when scrolling the white portal. The reason is that FM11 calls for an update of a specific rectangular area of the screen -- from x1,y1 to x2,y2 -- by executing the following sequence:
Clear the area
Paint the Body Fill Color
Paint any graphical elements "under" the portal
Paint the Portal Fill Color
Paint fields on the portal
Repeat for each movement of the portal's contents
What to do about it:
THE ULTIMATE SOLUTION IS to implement a specific Portal Refresh Color that would allow the developer to specify the best base color for the information being presented in the portal. But that would require adding a control parameter to portal definitions -- probably not something they can do in an short-order fashion.
A PRACTICAL INTERIM SOLUTION is to just bypass any refresh of the underlying colors and graphics and simply use the portal's designated Fill Color as the base color "starting point" for the refresh.
Now for the technical:
I believe FileMaker resolved most of the Windows flashing problems by properly applying GetUpdateRgn and WS_CLIPCHILDREN for the first time. The remaining flicker -- portals being the obvious case -- is likely due to the mis-application of $WM_ERASEBKGND (or hbrBackground). $WM_ERASEBKGND should never be used in a refresh situation ... unless the window is being resized. It will always induce a white flash effect proportional to the area being refreshed and the speed of the PC's graphics card.
Here are some relevant links that explain more:
So I say to FileMaker: Your goal was to conquer flashing on Windows PCs. Don't stop short. Finish the job while these issues are fresh on your collective mind -- get it 100% right. Then issue 11.01 as soon as possible. You'll gain a lot of goodwill and will restore a measure of confidence in the minds of hundreds of FMP developers.
Equally important, give us developers answers on this issue. Don't be mum. Is it your top priority? What is the specific plan for implementation? What is the probable time frame for an update to FM 11? The world is waiting to hear. Every day of delay means the circle of impact and of disappointment with FM 11 will widen. We'll help "sell" the plan. Just give us these answers.