Take tablet-mode switch state into account to automatically disable screen rotation when tablet-mode is 0
Hello!
There is devices that automatically enable/disable tablet-mode:
- Yoga-style devices enable tablet mode when keyboard is flipped behind the screen, and disable tablet mode when keyboard is flipped back and device looks like normal laptop.
- 2-in-1 tablets with detachable keyboard enable tablet mode when keyboard is disconnected and disable tablet mode when keyboard is connected.
tablet-mode SWITCH_TOGGLE events come from Intel Virtual Button driver and already supported by libinput.
I propose to take tablet-mode switch into account:
- If tablet-mode is 0 then set screen rotation to normal and set automatic screen rotation to disabled, but still allow user to enable it if he wants to for some reason.
- If tablet-mode is 1 and automatic screen rotation was disabled by "tablet-mode 0" then enable it.
- If tablet-mode is 1 and automatic screen rotation was disabled by used then keep it disabled.
Edited by RussianNeuroMancer