Unresponsive screen, except for when in power saving mode?

I had the same Problem it's a Bug with the Gyroscope Driver in Cyanogenmod for the HTC One M8. Fix is not yet Released but you may try the Test-Version