Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

screen

wpf

redraw

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?

like image 948
TalkingCode Avatar asked Nov 06 '22 03:11

TalkingCode


1 Answers

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.

like image 195
CodeWarrior Avatar answered Nov 10 '22 19:11

CodeWarrior