Add display rotation: Rot pill, chandra-ctl rotate, sensor auto-rotate
CI / test (push) Failing after 51s
CI / test (push) Failing after 51s
- Rotate the display 0/90/180/270 degrees in the KMS host, with scanout and libinput touch/pointer coordinates transformed to match - Add a touch "Rot" pill beside "KB": tap turns 90 CW, long-press or right-click flips 180 - Add `chandra-ctl rotate [cw|ccw|flip|0|90|180|270|status]`; CHANDRA_ROTATE sets the initial orientation - Add session/chandra-auto-rotate, which follows iio-sensor-proxy orientation (disable with CHANDRA_AUTO_ROTATE=0) - Advertise window_menu, maximize, fullscreen and minimize via xdg_toplevel.wm_capabilities (xdg_wm_base v5+) - Add docs/handset.md covering handset touch, scaling, OSK and rotation
This commit is contained in:
1 parent
905dab8725
commit
2e00009c79
21 files changed
+669
-63
No files matched your search
@@ -51,12 +51,21 @@ extern "C" fn c_fd(i : Int) -> Int = "mp_kms_fd"
|
||||
///|
|
||||
extern "C" fn c_set_power(on : Int) = "mp_kms_set_power"
|
||||
|
||||
///|
|
||||
extern "C" fn c_set_rotation(rot : Int) -> Int = "mp_kms_set_rotation"
|
||||
|
||||
///| Turn the screen on or off (DPMS). While it is off no frame is shown (`frame_ready` is
|
||||
/// false); on shows the last frame again.
|
||||
pub fn Kms::set_power(_self : Kms, on : Bool) -> Unit {
|
||||
c_set_power(if on { 1 } else { 0 })
|
||||
}
|
||||
|
||||
///| Rotate the output (`0=0`, `1=90 CW`, `2=180`, `3=270 CW`); returns new logical `(w, h)`.
|
||||
pub fn Kms::set_rotation(_self : Kms, rot : Int) -> (Int, Int) {
|
||||
let p = c_set_rotation(rot)
|
||||
((p >> 16) & 0xFFFF, p & 0xFFFF)
|
||||
}
|
||||
|
||||
///|
|
||||
pub(all) struct Kms {
|
||||
width : Int
|
||||
|
||||
Reference in new issue
Block a user