I installed Ubuntu 19.04 as soon as I got my Lenovo Ideapad Flex, and ever since then, I've had a problem, getting increasingly common, where if the screen automatically turns off after a time or I close the lid, the screen goes black as normal but the fan doesn't turn off (so it's not actually suspended), and the laptop is unresponsive to anything other than holding the power button to power off.
This question seems to match my problem exactly, but the solution (uninstalling package tlp) isn't relevant because I don't have tlp installed.
The problem seems to get more likely the longer the laptop is on and the more memory is in use. Also, if the laptop has been sitting there for a while and I pull out the power cord, the screen will turn off and if I don't immediately wake it up again, it enters the half-suspended state every single time.
Also, when a lot of memory is in use for a long time, the side with the icons and the top menu become unresponsive to clicking, and then later still the whole screen becomes unresponsive to clicking. In this state there's a very high likelihood that closing the screen will result in the half-suspended state.
Update:
My kernel is :
Linux joes-ideapad 5.0.0-38-generic #41-Ubuntu SMP Tue Dec 3 00:27:35 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux