Google Chrome freezes graphic system in fullscreen mode

Apr 3, 2016   #Ubuntu 14.04  #Google Chrome  #fix  #workaround  #youtube  #bug 

I was playing fullscreen youtube video, and all of a sudden graphic system died: sound goes on, but system does not respond to keyboard and the image is frozen. Of course, quick fix is to switch to TTY with Ctrl-Alt-F2, log in, and issue:

sudo service lightdm restart

Fix, but not workaround. I want my fullscreen youtube back!

Turns out, it is a regression in a recent version of Google Chrome. It was a bug before version 40, and it seems to be re-introduced somewhere before Version 49.0.2623.110 (64-bit). Switching Hardware acceleration in Chrome would be one option, but not the best one. Better option is to work around this in Compiz:

UNREDIR=$(gsettings get org.compiz.composite:/org/compiz/profiles/unity/plugins/composite/ unredirect-match | \
  perl -pe "s/'\$/ \& !(class=^google-chrome)'/ unless (/\(class=\^google-chrome\)/)") \
  && gsettings set org.compiz.composite:/org/compiz/profiles/unity/plugins/composite/ unredirect-match "$UNREDIR" \
  && unset UNREDIR