ccnb, may be your right, I noticed I have a line in the GetRenderList() that returns this
isActivated is set false by my popup code.Code:if (isActivated == false) { return new List<UiElement>(); }
Martin
ccnb, may be your right, I noticed I have a line in the GetRenderList() that returns this
isActivated is set false by my popup code.Code:if (isActivated == false) { return new List<UiElement>(); }
Martin
Last edited by mvallevand; 2011-12-29 at 08:08 PM.
Ok, but why is GetRenderList() on the plugin screen being called when NeedsRendering() for the plugin is returning false?
Given it's working for others, I'm inclined to think it will something that is being done in this plugin or screensaver, but I'm happy to take a closer look if you can provide the binary files for me to reproduce it here - without me having install extra apps on my development machine (which is currently nice and clean after a fresh Windows install on a new drive).
I think I have finally narrowed this down. It seems to be the black background in the popup causing it. The attached simple example plugin shows a popup with a black background when you select the single list item. I have NeedsRendering() for the popup always returning false. It sits there for several seconds not updating the time text and then all the sudden the time text is updating every second and GetRenderList() is called multiple times per second as can be seen in the log file. If I don't add the black background in GetRenderList() then this GetRenderList() call flurry never seems to occur.
I can post the whole project with source if you want. Here is how I am creating the black background/UIElement (as you suggested I do it when I asked a while ago):
Code:Bitmap black = new Bitmap(32, 32); Graphics g = Graphics.FromImage(black); g.Clear(Color.Black); g.Dispose(); _Black = new UiElement("screensaver-black", new RectangleF(0, 0, 100, 100), black, 255);
Is that code in your GetRenderList()?
Try defining "_Black" as a global variable. When you need the background, set a variable to true ("_needsBlack" for the purposes of this example).
Then modify the above code with:
Currently, it seems that you are creating and disposing the bitmap whenever you need to render _Black.Code:if (_needsBlack) { if (_Black == null) { Bitmap black = new Bitmap(32, 32); Graphics g = Graphics.FromImage(black); g.Clear(Color.Black); g.Dispose(); _Black = new UiElement("screensaver-black", new RectangleF(0, 0, 100, 100), black, 255); } } else if (_Black != null) { _Black = null; }
Ah, then ignore everything I just said. Can you post the source to that test plugin?
Last edited by cncb; 2012-01-14 at 06:23 PM.