When I tried Ubuntu 11, I hated it because when I closed laptop lid, it crashed. I changed to Linux Mint 10 and was happy to see that changed. However, I now updated to Mint 11 and I have the same issue.
So I made some investigation on it and disabling VBlank on OpenGL in compiz-settings-manager works for most people. Not for me, though. This worked:
gconftool-2 --type string --set /apps/gnome-power-manager/buttons/lid_ac "nothing"
Note: Almost nobody in the Web knows this and I found it on the last comment of a very hidden page, so thought I should share it.