My ubuntu 16.04 with gnome desktop won't go to sleep or lock the screen. In the power options menu I have set 'blank screen' to 5 minutes, and 'dim screen when inactive' to on. Also, I noticed that scrolling the screen brightness slider isn't working. So I can imagine that the screen brightness is set to 0 when inactive, but the mechanism behind that simply doesn't work, although my screen also doesn't lock. I've found some information about this by googling, but it's all about older ubuntu versions so I don't think it applies to me.