I recently installed the latest ubuntu 18 and randomly the screen just rotates, i usually have to CTRL+ALT+T to bring up the terminal and do xrandr -o normal
to get back the screen display correctly. I have gone through the internet in search of the cause and also I know there is a similar question on Screen randomly rotates on Ubuntu 17.10, but all those solutions worked for devices that have orientation capabilities, am on a HP Laptop which DOES NOT support orientation laptop, what could be the reason and how do I fix this. Any help please would be really appreciated.
EDIT:
Laptop model is HP ProBook 4540s
Click on the upper right corner of your screen to get mini settings drop down. Click on the third icon from the right on the bottom of the drop down (it looks like a rectangle at 45 degrees). It should then show a small lock icon on the rectangle. That locks the rotation.
Edit: This is in the thread you linked. I missed it before posting.
I had the same problem on my HP envy. The rotation lock button that John mentioned helped a little, but the screen would still rotate any time I closed the lid regardless of the lock. I did the following:
And I haven't had the problem since.