TalkingCode
TalkingCode

Reputation: 13567

WPF Application windows does not fully refresh after screen awakes from sleep

Today we found a little strange problem in one of our WPF application and we are not exactly sure how to deal with it. When we run the software on one of our laptops the screen goes to sleep (turns black) after a while when there is no user interaction. It application itself is still busy downloading data from the internet and filling tables in a database. There is also a progress bar and a status bar.

If we wake the screen simply by moving the mouse the program is shown again but some parts of the window are not refreshed. The progress bar is still showing values even if the process is completed and the status bar is also wrong.

From this time on you can work with the program like nothing happened but progress bar and status bar will only be redrawn if you minimize the complete window to the task bar and maximize it again. Or if you start another action that will also use progress bar or status bar.

This strange behavior caused a lot of confusion because the displayed data seems to be wrong after the screen awakes from sleep and you need to minimize and maximize the window to see what is really going on.

What is wrong here?

Upvotes: 5

Views: 1323

Answers (2)

bryanbcook
bryanbcook

Reputation: 18393

Make sure that the background operation isn't hogging the UI thread. But as Cory suggests, it could be a video driver problem.

Upvotes: 0

CodeWarrior
CodeWarrior

Reputation: 7468

Are the video drivers up to date? If not, you might try updating them. WPF utilizes video hardware for it's rendering. I have had some refreshing problems before and new drivers fixed it.

Upvotes: 2

Related Questions