Lots of flashing with floating panes |
Post Reply |
Author | |
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 891 |
Post Options
Thanks(0)
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.
|
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 891 |
Post Options
Thanks(0)
|
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.
|
|
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 891 |
Post Options
Thanks(0)
|
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.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |