I have implemented CDirectScreenAccess on Series60 (NGage) and it works absolutely fine for task-switches, when the application key is pressed.
However, when a dialog is displayed (eg. phone charger is plugged in, battery is low, incoming call, etc) or the application menu appers - the screen display completely messes up : the area where the dialog was is fine, but the area not covered by the dialog becomes flickery (not being updated?).
I have read all the other relevant threads in the forums about this btw!! It seems that several people have this problem, but nobody has revealed a definitive solution for it.
I suspect that this problem is to do with the order of HandleForegroundEventL() and/or CDirectScreenAccess::AbortNow() & Restart().
Could it be that Restart() is being called too early, before the dialog box has disapperated. We are supposed to call StartL() from within this function, and StartL() is supposed to internally update the drawing region for the application - but if the dialog is still active then might that mess up the drawing region.
I should mention that I get the drawing region, and set the clipping region on the GC every frame to be on the same side.
Does anyone (experts??) have the definitive solution to handling dialogs and suchlike, within the CDirectScreenAccess() system - as there does seem to be a problem with this.
Re: CDirectScreenAccess goes wrong when a dialog is displayed
I got a same situation with you, and I had been pained for several days ago . and then I fixed it by follow codes:
if(err == KErrNone)
* The key code here, determine the Region.whether it draw the full screen, otherwise I do nothing.
aRegion = iDirectScrAccess->DrawingRegion();
if(Rect() != aRegion->BoundingRect())