Ubuntu 16.10 screen flicker after monitor wake up

In Ubuntu 16.10, when my monitors wake up on my 3rd generation Intel Core i7 laptop (HD 4000 graphics), I get flickering on both my built in laptop screen and my external display. It goes away when I bring a full screen window to the front.

It only happens when my screen goes to sleep and then wakes up when I move the mouse. It's not a very serious problem since I just need to move windows or bring them to the front to stop the flickering, but it's annoying and I want to fix it. I would appreciate any help.


Make sure you have Compiz installed and enable "Don't wait for video sync" and "Force complete redraw on initial damage"

Compiz -> Utility -> Workarounds -> Don't wait for video sync

Compiz -> Utility -> Workarounds -> Force complete redraw on initial damage

sudo apt-get install compiz compizconfig-settings-manager

I still get one flash but it is significantly better and enabling some of the other workarounds might fix it completely for other people.