Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - Lots of flashing with floating panes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Lots of flashing with floating panes

 Post Reply Post Reply
Author
Message
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 629
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Topic: Lots of flashing with floating panes
    Posted: 24 May 2019 at 3:45pm
When we call SetLayout, any panes we have in floating containers end up causing the floating containers to flash like crazy. We do have a lot of panes. The issue is that CXTPDockingPaneManager::SetLayout calls _DetachAll() and _DetachAll() loops thru each pane and calls Detach on the pane. In CXTPDockingPane::Detach(), a call is made right back to the manager to call _Redraw. Then after the manager _DetachAll returns, the manager calls _Redraw.

Can CJ modify the code to keep each pane Detach from causing _Redraw to be called (via a flag passed in to Detach) or, the manager could set a flag "I'm in _DetachAll" and when _Redraw is called, ignore the call. We have derived from the CJ manager so I would override those APIs but they are not virtual. If SetLayout were virtual, we could override it and implement our own _DetachAll and/or _Redraw.

Note that even if I have just one floating container, it gets redisplayed once for each pane in the pane manager's list as the pane manager _Redraw code redraws everything. Users are beating us up on this one. Especially users that float multiple panes in different containers.
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 629
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 2019 at 4:33pm
I added a flag to the manager and set it in SetLayout before calling _DetachAll. Checked the flag in _Redraw and exited. Cleared the flag in SetLayout after _DetachAll so the call to _Redraw would execute. So far, I have seen no ill side effects and all the flashing is gone. Nice, clean display.

If any CJ person reads this, let me know if there is something I might not have tested. I floated panes, I have multiple dock sites on the left and right side of the app. MDI tests where different panes are used by each document type. Pinned, unpinned ... Hope I didn't miss anything.

Would be great if CJ added code to stop the flashing so I don't have to edit each build we pull to add this code to that build before we compile the toolkit.
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 629
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Posted: 28 May 2019 at 11:47am
For our purposes I also added a method to set that flag as it turns out we have cases where we have to detach objects and then issue a redraw call when we are done. So I set the flag to avoid redraws while we call Detach and clear it after detaching. Then we call the API to redraw (just a wrapper that calls _Redraw). I would have called an analogous API that wraps _DetachAll but it didn't exist. Would be nice to have an API that wraps _DetachAll that can be used to avoid all the drawing until all are detached.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.125 seconds.