none
Flickering background when resizing window RRS feed

  • Question

  • I'm experimenting with Avalon and I notice heavy flickering when a window is resized. This can be easily seen by just creating a blank Avalon project with Visual Studio and (rapidly) resizing this application's main window. What I see is a white background, with parts of it flashing to black (and back to white) when the window is resized. I thought that Avalon is supposed to eliminate flickering, so what am I doing wrong?
    Friday, October 14, 2005 6:56 PM

Answers

  • The good news is you aren't doing anything wrong Smile.

    The "no flicker" behavior really applies to changing window contents on a window of static size and position. Unlike other graphics platforms, Avalon applies all of your UI changes atomically, which is what prevents the flickering.

    If you resize the window, however, things are slightly more complicated because more components are involved. In addition to Avalon drawing the window's client area, ntuser and/or the theming service also need to draw the non-client area, so keeping things atomic involves synchronizing all of those components. What you are observing is a temporary by-product of Avalon's asynchronous rendering architecture. We are working on addressing this issue for a future drop, though, so stay tuned.

    Wednesday, October 19, 2005 5:18 AM

All replies

  • The good news is you aren't doing anything wrong Smile.

    The "no flicker" behavior really applies to changing window contents on a window of static size and position. Unlike other graphics platforms, Avalon applies all of your UI changes atomically, which is what prevents the flickering.

    If you resize the window, however, things are slightly more complicated because more components are involved. In addition to Avalon drawing the window's client area, ntuser and/or the theming service also need to draw the non-client area, so keeping things atomic involves synchronizing all of those components. What you are observing is a temporary by-product of Avalon's asynchronous rendering architecture. We are working on addressing this issue for a future drop, though, so stay tuned.

    Wednesday, October 19, 2005 5:18 AM
  • Thanks, that explains it. Any idea in which timeframe we will see these changes (beta 2 or later)?
    Wednesday, October 19, 2005 5:38 PM
  • Unfortunately the fix for this issue is not going to make the Beta 2 release.
    Wednesday, October 19, 2005 8:54 PM
  • Any chynges? I thing its same thig like my problem ?

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1134237&SiteID=1

    Thx

    Sunday, January 21, 2007 5:21 PM
  • Unfortunately, I'm seeing exactly the same problem as listed at the top of the thread - whenever I resize a plain old wpf window (the one in Martin's post is a great example) I get lots of black flickering. The background is wiped out and I just see black.

     

    Personally, I think this is a shocking issue. WPF is supposed to be the future of UIs on Windows, and coupled with Vista's DWM, I'd expect rock solid animation and smooth-ness. What use is a new display technology that can't even resize a window cleanly? With all due respect, Flash can do this without any problems. I'm not trolling, I'm just very disappointed - I want to use WPF, but can't see how I can unless I prevent my customers from resizing the window.

     

    Anyone got any ideas?

    Thursday, June 7, 2007 11:02 AM
  • Have the exact same problem on Vista x64. It's quite poor that resizing an application can be such a dodgy experience!

     

    In my case the background flickers black and I see through the right hand side of the WPF application to whatever window I have open below - in this case IE7.

    Sunday, June 17, 2007 11:06 PM
  • I would like to apologize for this poor experience.  When delivering a new rendering stack, lots of technical pieces have to be integrated carefully.  This is an example of where we dropped the ball.  We are working on a fix.  I know issues like this are very frustrating, and again, I apologize for the pain.
    Thursday, June 28, 2007 8:34 PM
  • Hi Dwayne. Thanks for the reply. I guess a product the size and complexity of WPF is a bit of a challenge, and V1 is bound to have some issues. But it's generally dead good stuff - the more I dig into it, the more impressed I am.

     

    Glad to hear you're working on a fix - thanks for the feedback.

     

    And "very frustrating". Yeah - I think I was just venting...

     

    Cheers

    Matt

     

    Thursday, July 5, 2007 8:37 PM
  • Hi today the problem seems still present. I tried on vista.
    Wednesday, July 11, 2007 7:09 PM
  • The problem  should only be visible on Vista with the Aero theme (DWM on). As described above, it is a complex interaction issue between the new window management system and D3D. Since WPF is built on top of D3D it suffers from this issue too. We are working on a fix and I will post an update here once the fix becomes available.

    If you are seeing the same flickering on XP on resize please let us know.

    Sunday, July 22, 2007 5:32 AM
  • With our (Direct3D) application it only happens _only_ on Vista with DWM on.
    The whole window flashes black.

    I could reproduce this with some of samples from the
    Direct3D SDK, so I know that this is not entirely our issue.

    Is there a work around? This is extremely bad for us.
    Any time estimates for the fix? Any way to track progress (connect.microsoft.com
    issue number or something)?

    Thanks,
        Dmitri

    Saturday, September 1, 2007 12:54 AM
  •  

    I agree that this issue has to be addresed now. How would one explain to the client why all the windows are happily flickering like a strobo light.
    Wednesday, October 3, 2007 7:33 PM
  • I have some good news. This issue should be addressed in Vista SP1.

    Saturday, October 6, 2007 8:19 AM
  • And what with popular XP? Thats rather bad news Sad

     

    Saturday, October 6, 2007 10:35 AM
  • I should have been clearer in my last message. The issue is specific to Vista and is caused by an integration issue between DX and desktop composition (DWM/Aero Glass). Because WPF is based on DX, WPF applications show the same flicker on resize. This specific DX/DWM integration issue is fixed in SP1.

     

    XP is using a very different compositing model and is therefore not affected.

     

     

     

    Tuesday, November 13, 2007 8:06 AM
  • Can someone please provide a status update on this problem?  As mentioned in previous posts, its possible to ship application with this flicker effect.

     

    Monday, December 10, 2007 7:43 PM
  • There is no change in status since my previous post. The issue we are aware of is caused by an integration issue between Vista's DWM and DX and should be fixed in SP1. If you are looking for more specific information that is not covered please let us know.

    Monday, December 10, 2007 8:35 PM
  • With vista SP1 RC, the flicker is gone on the main monitor.  But on my setup with dual monitor, if I resize the window to across two monitors, the flicker occurs again.

    Saturday, December 22, 2007 10:23 PM
  • Yes, when you resize across two monitors the flickering might still occur on some hardware. We weren't able to address this scenario in the SP release. The fix should address the flicker though on a dual monitor setup as long as the window is only on one monitor.

    Thursday, January 3, 2008 2:42 AM
  •  Gerhard Schneider - MSFT wrote:

    I have some good news. This issue should be addressed in Vista SP1.



    This is good to hear. I was a little disappointed when I found this making my first WPF app, but knowing that it's been acknowledged and being worked on is very reassuring. I look forward to SP1!
    Wednesday, February 27, 2008 9:52 PM
  • It seems you all agree the problem has been fixed now?  Unfortunately, I'm running Vista SP1 and am seeing a similar issue.

    Basically, I've got a element host control on a WinForm and a WPF control inside of it.  If I resize the element host (and therefore the wpf control) I see the same black flicker you're talking about here.  But it seems to go beyond that, if I resize just the WinForm (not causing the element host to resize) I see the black section over the redrawn parts of the element host control.

    Am I doing something wrong here?  Or is this issue not fully resolved yet?

    (Vista SP1, DWM, clean C# .Net 3.5 project)

    Kyle
    • Edited by pdev.mich Monday, June 23, 2008 7:56 AM added environment details
    Monday, June 23, 2008 7:42 AM
  • Gerhard Schneider - MSFT said:

    I should have been clearer in my last message. The issue is specific to Vista and is caused by an integration issue between DX and desktop composition (DWM/Aero Glass). Because WPF is based on DX, WPF applications show the same flicker on resize. This specific DX/DWM integration issue is fixed in SP1.

     

    XP is using a very different compositing model and is therefore not affected.

    Hi
    this issue is present in XP, we have a code where we resize windows, and the UI flickers.
    Now after using SP1 in vista the flicker is gone, but the same application in XP still flickers.

    So how can this issue not be with XP if the same code works for one and does not work for Other OS.

    please confirm and if there is some settings that needs to be done in XP please suggest.
    Thursday, October 16, 2008 8:16 AM
  • I know this is an old post but I have hit the flicker problem on XP where I'm using WPF to update the GUI, has anything been done to address the XP flicker problem?
    Monday, October 20, 2008 3:08 PM
  • Was this problem ever fixed? My app is written in .NET 4.0 and I'm running Win 7 -32 bits. Once I change the theme from Aero to Window Classic flickering disappears.  
    Thursday, February 10, 2011 2:38 AM
  • I too am experiencing this issue with .NET 4.0 on Win7 x64. As javier said the problem only occurs with Aero theme enabled. It's even fine with Windows 7 Basic theme. Only aero is the problem. But why then is this problem not apparent with Windows Live Messenger? It is my understanding that WLM now uses WPF and yet somehow they've overcome this issue? Why can't we???  ...kinda lame...
    Tuesday, April 26, 2011 11:22 PM
  • It has been something like 6 years, and this issue continues. Why? It is issues like this that prevent WPF from becoming the choice of application developers, and I'm just really disappointed!

    6 YEARS!

    Saturday, July 9, 2011 6:05 PM
  • Is there a way of at least changing the colour of the background during the redraw on resize?

    With a mostly white application the area waiting to be redrawn in black is very noticable.

    Wednesday, August 3, 2011 5:57 PM