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

+18
View File
@@ -228,6 +228,8 @@ struct ClientConn {
pointer_ids : Array[UInt]
keyboard_ids : Array[UInt]
mut seat_ver : UInt
/// xdg_wm_base version the client bound (`wm_capabilities` arrived in v5).
mut xdg_ver : UInt
/// wl_data_device ids this client created (they receive selection events).
data_devices : Array[UInt]
/// wl_data_source id -> mime types it offers.
@@ -269,6 +271,7 @@ fn ClientConn::new(client_id : UInt, fd : Int) -> ClientConn {
pointer_ids: [],
keyboard_ids: [],
seat_ver: 1U,
xdg_ver: 1U,
data_devices: [],
data_sources: {},
prim_devices: [],
@@ -673,6 +676,7 @@ fn WaylandServer::dispatch_msg(
emit_shm_formats(c, new_id)
} else if iface == "xdg_wm_base" {
c.objects.set(new_id, ObjXdgWmBase)
c.xdg_ver = ver
} else if iface == "zxdg_decoration_manager_v1" {
c.objects.set(new_id, ObjDecoManager)
} else if iface == "org_kde_kwin_server_decoration_manager" {
@@ -1298,6 +1302,20 @@ fn WaylandServer::dispatch_msg(
wants_csd: false,
})
self.win_to_client.set(wid, c.client_id)
if c.xdg_ver >= 5U {
// Advertise all standard window actions (window_menu, maximize, fullscreen, minimize)
// so GTK/Chromium CSD clients enable their Maximize button.
let caps : Array[Byte] = []
for cap in [1U, 2U, 3U, 4U] {
caps.push((cap & 0xFFU).to_byte())
caps.push(((cap >> 8) & 0xFFU).to_byte())
caps.push(((cap >> 16) & 0xFFU).to_byte())
caps.push(((cap >> 24) & 0xFFU).to_byte())
}
let wc = WireWriter::new()
wc.array(caps)
c.send_msg(wc.finish_msg(tl_id, 3U))
}
} else if opcode == 2U {
// get_popup(id, parent: xdg_surface?, positioner)
let pid = reader.u32()