Direct Screen Access goes wrong when menu/dialog appears

Login to reply to this topic.
Wed, 2004-12-08 12:40
Joined: 2003-08-22
Forum posts: 6
Hi,

Anyone else seen this happen ?

The CDirectScreenAccess class works fine for task-switching, calls AbortNow() and Restart() as its supposed to - and there I can call Cancel() & StartL().

However, try plugging in the phone charger or pressing the menu softkey..  AbortNow() will still be called, but this time when I call StartL() again - the screen display is all messed up : half of it is not being updated, and the top part of my application is being drawn about halfway down the screen.

Anybody else observed this happening, or have a solution for it?
Perhaps I'm doing something wrong (although I took my implementation directly from the Nokia Direct Screen Access example).  Does this problem sound familiar to anybody?  Help would be much appreciated, as I've tried many things now to fix it but I'm stumped..

CW

Wed, 2004-12-08 14:30
Joined: 2004-05-26
Forum posts: 69
Direct Screen Access goes wrong when menu/dialog appears
Yes I experienced the same - I think this is a bug in s60.
Wed, 2004-12-08 15:00
Anonymous (not verified)
Forum posts: 2043
Direct Screen Access goes wrong when menu/dialog appears
hi slajerek,

Glad to hear someone else has this problem too!

However I've tried various games on the N-Gage, and they don't have the problem - you can plug in & out the battery recharger and the dialog appears, but it doesn't mess up the screen.

So if this *is* a bug with series 60, there must be some way around it!!

CW
Wed, 2004-12-08 15:10
Joined: 2004-05-26
Forum posts: 69
Direct Screen Access goes wrong when menu/dialog appears
hmm, as I remember there's some function like got focus/lost focus to walk around this...
Tue, 2004-12-21 04:47
Joined: 2003-08-22
Forum posts: 6
Fixed at last
Looks like my problem was in sharing my offscreen backbuffers (CFbsBitmap's) across two threads.

After a system dialog was displayed, Symbian took a dislike to me accessing the DataAddress() from the other thread (although all access was controlled by semaphores).

I've now switched to using shared memory-buffers instead of CFbsBitmap's and everything is fine.
Thu, 2005-01-13 11:26
Joined: 2004-01-26
Forum posts: 6
Direct Screen Access goes wrong when menu/dialog appears
The problem is with the function DataAdress() with which you get the address of the bitmap data from a CFbsBitmap.

You should only call DataAdress() on your CFbsBitmap at object construction and never ever afterwards. This is why N-Gage games work properly.
Thu, 2005-01-13 13:45
Joined: 2003-08-22
Forum posts: 6
Direct Screen Access goes wrong when menu/dialog appears
Okay, thanks for the advice..

I'm very puzzled though - I don't remember reading that in the documentation; do you have a link to the SDK help section?

I also don't see why this would be so, and for what reason it should not be possible to call DataAddress() at will.  Do you mean that this function should only be called within the constructor of a derived class, or is it safe to use it immediately after the bitmap's construction?

Some other graphics API's hide the fact that bitmap memory may be internally reallocated or moved, by using a Lock()/Unlock() syntax.  Surely Symbian would have implemented something similar if it there was any reason why the data chouldn't be freely accessed at will?

Incidentally, I have used the DataAddress() function quite frequently during the course of a program before without any problems - but it was only when I tried to do this across threads that I ran into this issue...

Many Thanks
CW
Thu, 2005-01-13 14:03
Joined: 2004-01-26
Forum posts: 6
Direct Screen Access goes wrong when menu/dialog appears
The fact that DataAdress() returns a wrong "memory" pointer is a bug in some symbian implementations on some phones. For sure I can say that the bug is in the N-Gage platform (Symbian 6.1).

You are right, the memory could be reallocated in some circumstances, but we never experienced that. There is also no hint in the SDK help on this. It is just our experience.

We had that problem also in a single threaded application on an N-Gage QD.
Thu, 2005-01-13 14:32
Joined: 2004-06-06
Forum posts: 205
Direct Screen Access goes wrong when menu/dialog appears
Quote from: jobe
The fact that DataAdress() returns a wrong "memory" pointer is a bug in some symbian implementations on some phones. For sure I can say that the bug is in the N-Gage platform (Symbian 6.1).

What do you mean by "wrong memory pointer"? You need to know that this adress can change in run-time. and BTW i use this function on n-gage and it works great.

Best regards,
Michal Laskowski

Thu, 2005-01-13 15:50
Joined: 2003-08-22
Forum posts: 6
Direct Screen Access goes wrong when menu/dialog appears
In my code, I always called DataAddress() immediately before accessing the returned bitmap data - so there was no way that the data address could have been 'out of date'.

The only thing I was doing which could have caused this problem, was to use a bitmap in one thread which had been created from within another thread.

CW
Mon, 2005-01-17 05:31
Joined: 2003-12-09
Forum posts: 11
Direct Screen Access goes wrong when menu/dialog appears
I have the same problem while I press power button. But I have no problm with the incoming call.

If i plug the charger, the app errors (app closed). How do i solve this problem?

Thanks

Mon, 2005-01-17 07:02
Joined: 2003-12-09
Forum posts: 11
problem slove?
After I change (re-assign) the pointer in DSA (StartL), both of them are solved. So this pointer to buffer sometimes can crash the program !!!
I tested with the charger (more than 10 times) the screen displays properly.

Mon, 2005-02-07 10:51
Joined: 2005-01-07
Forum posts: 9
screen image shifting
Hello,

I have the same problem...

I draw to the whole screen by using the view class. I get the window associated to the view and system gc and do a bit blit from an offscreen-bitmap.

That works fine, everything is in place UNTIL I press the left softkey and the usual pop-up menu appears. When I cancel it, the image blitted to screen is shifted downwards. Only the portion of the screen that the menu took up, gets now updated. The upper portion is left untouched and is not updated.

When I start up the Series60 emulator and the first thing I do is launch my application, the problem does not occur. Only when I close the application and re-launch it in the same emulator-session, the problem starts.
The problem also appears when I the press the "application" button, start another application in the meantime and later return to my still-running first application.
The appearance of the problem is the same on emulator and on phone ( Nokia 6600 ).

I would be happy for any help/suggestions!!

Victor
Fri, 2006-10-20 10:03
Joined: 2006-10-20
Forum posts: 1
Re: Direct Screen Access goes wrong when menu/dialog appears
I had make a log when this happen .
Andit looks like that  the iGc->DrawingRegion
changed to the region of popmenu or infobox.
If you check the region of a infobox when charge plugin  the region boundbox
become a (0,44,176,110) not (0,44,176,188)as normal.
I used bitmap dataAdress too at construct .
Im sure if you can change the iGc->DrawingRegion you can resolve this.(but it looks like very hard )
Or if you can get adrss just before use.

Fri, 2006-10-20 13:46
Joined: 2004-11-29
Forum posts: 1273
Re: Direct Screen Access goes wrong when menu/dialog appears
Lots of confused posts in this thread...

The most important information I have is this:

The call to DataAddress MUST ALWAYS be called between LockHeap and UnlockHeap and the value returned must NEVER be used outside those in any way.

The bitmap WILL move, and will do this at points you can NEVER predict.

If it have seemed to work without following the above, you have just been "lucky".
Fri, 2006-10-20 13:50
Joined: 2004-11-29
Forum posts: 1273
Re: Direct Screen Access goes wrong when menu/dialog appears
windcao:
The region returned by DrawingRegion is the region where you are safely allowed to draw. That is, the area of your window/view that is not covered by the menu/popup.

You should ALWAYS respect this region, or you could just as well skip useing DSA all together, and just grap the framebuffer pointer from HAL. (wich ofcourse will work crap, just as it will if you ignore the region returned by DSA)

If you do not want to draw when not your entire view is visible (maybe your render code doesn't support to draw to subregions), then you should check the region so that it matches what you expect.
  • Login to reply to this topic.