A nicer workaround could be to modify
- automatically enable screen refresh when switching to landscape;
- returning to default value (whichever it was) when switching back to portrait;
I guess that setting refresh on/off could be done with something like:
lipc-set-prop com.lab126.winmgr refreshOnTurn 1|0
I don't know how it could be read.