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
@@ -137,3 +137,43 @@ test "OSK auto-opens on launcher popup, lifts popup above OSK, and types into se
|
||||
assert_eq(comp.shell.launcher_state.query, "t")
|
||||
comp.close()
|
||||
}
|
||||
|
||||
///|
|
||||
test "Rot pill tap rotates CW, right-click flips 180 deg, and rotate control commands update size" {
|
||||
let comp = osk_comp("rotate")
|
||||
let rr = comp.osk_rotate_rect()
|
||||
let rx = rr.x + rr.w / 2
|
||||
let ry = rr.y + rr.h / 2
|
||||
|
||||
// Tap Rot pill -> queues 90 deg CW rotation.
|
||||
click_at(comp, rx, ry, 10U)
|
||||
assert_eq(comp.take_pending_rotation(), Some(1))
|
||||
assert_eq(comp.current_rotation(), 1)
|
||||
comp.apply_rotated_size(1170, 540)
|
||||
assert_eq((comp.output_w, comp.output_h), (1170, 540))
|
||||
|
||||
// Right-click / long-press Rot pill -> queues 180 deg flip (1 -> 3 = 270 deg).
|
||||
let rr2 = comp.osk_rotate_rect()
|
||||
click_at(comp, rr2.x + rr2.w / 2, rr2.y + rr2.h / 2, 20U, btn=273U)
|
||||
assert_eq(comp.take_pending_rotation(), Some(3))
|
||||
assert_eq(comp.current_rotation(), 3)
|
||||
|
||||
// chandra-ctl rotate 0 / flip / status.
|
||||
let (out0, ok0) = comp.control_command("rotate 0")
|
||||
assert_true(ok0)
|
||||
assert_eq(out0, ["ok rotate 0"])
|
||||
assert_eq(comp.take_pending_rotation(), Some(0))
|
||||
comp.apply_rotated_size(540, 1170)
|
||||
|
||||
let (out_flip, ok_flip) = comp.control_command("rotate flip")
|
||||
assert_true(ok_flip)
|
||||
assert_eq(out_flip, ["ok rotate flip"])
|
||||
assert_eq(comp.take_pending_rotation(), Some(2))
|
||||
comp.apply_rotated_size(540, 1170)
|
||||
assert_true(comp.frame_changed)
|
||||
|
||||
let (out_st, ok_st) = comp.control_command("rotate status")
|
||||
assert_true(ok_st)
|
||||
assert_eq(out_st, ["ok 180 540x1170"])
|
||||
comp.close()
|
||||
}
|
||||
Reference in new issue
Block a user