Add display rotation: Rot pill, chandra-ctl rotate, sensor auto-rotate
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:
nandi committed 2026-11-28 00:39:24 -08:00
1 parent 905dab8725
commit 2e00009c79
21 files changed
+669 -63

No files matched your search

+3
View File
@@ -21,6 +21,9 @@ fn wasmImportSetCursorShape(p0 : Int) = "chandra:host/display@0.1.0" "set-curso
///|
fn wasmImportSetPower(p0 : Int) = "chandra:host/display@0.1.0" "set-power"
///|
fn wasmImportSetRotation(p0 : Int) -> Int = "chandra:host/display@0.1.0" "set-rotation"
///|
fn wasmImportTakeInput(p0 : Int) = "chandra:host/display@0.1.0" "take-input"
@@ -35,6 +35,11 @@ fn wasmImportSetPower(p0 : Int) -> Unit {
abort("wasm-only host import")
}
///|
fn wasmImportSetRotation(p0 : Int) -> Int {
abort("wasm-only host import")
}
///|
fn wasmImportTakeInput(p0 : Int) -> Unit {
abort("wasm-only host import")
@@ -18,6 +18,8 @@ pub fn set_cursor_shape(UInt32) -> Unit
pub fn set_power(Bool) -> Unit
pub fn set_rotation(UInt32) -> UInt32
pub fn take_input() -> Array[SeatEvent]
// Errors
+8
View File
@@ -103,6 +103,14 @@ pub fn set_power(on : Bool) -> Unit {
wasmImportSetPower((if on { 1 } else { 0 }));
}
///|
/// Rotate the output (0 = 0 deg, 1 = 90 deg CW, 2 = 180 deg flip, 3 = 270 deg CW).
/// Returns `(width << 16) | height` of the new logical output size.
pub fn set_rotation(rot : UInt) -> UInt {
(wasmImportSetRotation((rot).reinterpret_as_int())).reinterpret_as_uint()
}
///|
/// Input queued since the last call.