- remote/: shared-memory framebuffer mirror served as RFB 3.8 (VNC, port 5900) and an HTTP/WebSocket PWA (port 6080), bound to the Tailscale interface and loopback by default - Compositor: remote pointer, button, scroll, modifier, key, key-tap, text and clipboard input, routed past OLED blanking - chandra-ctl: add status, refresh and osk commands; add input-* and clipboard-set for remote control - Camera: debayer 10-bit CSI-2 Quad-Bayer frames for imx371 and high-quality still capture - Camera: rotate frames by the libcamera mounting angle (CCW for 90), fix the expected test values, and restyle the UI for a dark theme
This commit is contained in:
1 parent
de39b74282
commit
bfc60ee0e5
24 files changed
+5310
-79
No files matched your search
@@ -2067,6 +2067,107 @@ pub fn ChandraCompositor::handle_input(
|
||||
self.osk_sync()
|
||||
}
|
||||
|
||||
///| Route remote input (from chandra-remote): bypasses physical-display blanking so remote
|
||||
/// sessions can control an OLED-blanked device without unblanking its panel.
|
||||
pub fn ChandraCompositor::handle_remote_input(
|
||||
self : ChandraCompositor,
|
||||
ev : @nested.InputEvent,
|
||||
time_ms : UInt,
|
||||
) -> Unit {
|
||||
self.note_activity(@sys.monotonic_ms())
|
||||
self.dispatch_input_inner(ev, time_ms)
|
||||
self.osk_sync()
|
||||
}
|
||||
|
||||
///| Inject a key tap with temporary modifier bitmask, restoring prior modifiers afterwards.
|
||||
pub fn ChandraCompositor::remote_key_tap(
|
||||
self : ChandraCompositor,
|
||||
code : UInt,
|
||||
mods : UInt,
|
||||
time_ms : UInt,
|
||||
) -> Unit {
|
||||
let saved_mods = self.mods
|
||||
let saved_lat = self.mods_latched
|
||||
let saved_lock = self.mods_locked
|
||||
let saved_group = self.mods_group
|
||||
let need_mod = mods != saved_mods || saved_lat != 0U
|
||||
if need_mod {
|
||||
self.handle_remote_input(Modifiers(mods, 0U, saved_lock, saved_group), time_ms)
|
||||
}
|
||||
self.handle_remote_input(Key(code, true), time_ms)
|
||||
self.handle_remote_input(Key(code, false), time_ms + 1U)
|
||||
if need_mod {
|
||||
self.handle_remote_input(
|
||||
Modifiers(saved_mods, saved_lat, saved_lock, saved_group),
|
||||
time_ms + 1U,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
///| Put UTF-8 text on the compositor's own Wayland clipboard.
|
||||
pub fn ChandraCompositor::remote_set_clipboard(
|
||||
self : ChandraCompositor,
|
||||
text : String,
|
||||
) -> Unit {
|
||||
self.server.set_own_selection(
|
||||
["text/plain;charset=utf-8", "text/plain", "UTF8_STRING"],
|
||||
@utf8.encode(text),
|
||||
)
|
||||
}
|
||||
|
||||
///| Commit UTF-8 text directly to the active popup, Wayland text-input-v3 surface, or desktop;
|
||||
/// falls back to putting the text on the clipboard when no text sink accepts it.
|
||||
pub fn ChandraCompositor::remote_commit_text(
|
||||
self : ChandraCompositor,
|
||||
text : String,
|
||||
) -> Bool {
|
||||
self.note_activity(@sys.monotonic_ms())
|
||||
if self.shell.popup_open() {
|
||||
for ch in text {
|
||||
let name = match ch {
|
||||
'\n' => "Enter"
|
||||
'\t' => "Tab"
|
||||
_ => ch.to_string()
|
||||
}
|
||||
self.shell.key_down(name)
|
||||
}
|
||||
self.run_shell_actions()
|
||||
self.damage.mark_full()
|
||||
self.frame_changed = true
|
||||
return true
|
||||
}
|
||||
match self.kbd_win {
|
||||
Some(wid) =>
|
||||
if self.server.text_input_commit(wid, text) {
|
||||
self.damage.mark_full()
|
||||
self.frame_changed = true
|
||||
return true
|
||||
}
|
||||
None =>
|
||||
if self.shell.desktop_has_focus() {
|
||||
let mut took = false
|
||||
for ch in text {
|
||||
let name = match ch {
|
||||
'\n' => "Enter"
|
||||
'\t' => "Tab"
|
||||
_ => ch.to_string()
|
||||
}
|
||||
if self.shell.desktop_key(name) {
|
||||
took = true
|
||||
}
|
||||
}
|
||||
if took {
|
||||
self.run_shell_actions()
|
||||
self.damage.mark_full()
|
||||
self.frame_changed = true
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
self.remote_set_clipboard(text)
|
||||
false
|
||||
}
|
||||
|
||||
///|
|
||||
fn ChandraCompositor::handle_input_inner(
|
||||
self : ChandraCompositor,
|
||||
@@ -2095,6 +2196,15 @@ fn ChandraCompositor::handle_input_inner(
|
||||
return
|
||||
}
|
||||
self.note_activity(@sys.monotonic_ms())
|
||||
self.dispatch_input_inner(ev, time_ms)
|
||||
}
|
||||
|
||||
///|
|
||||
fn ChandraCompositor::dispatch_input_inner(
|
||||
self : ChandraCompositor,
|
||||
ev : @nested.InputEvent,
|
||||
time_ms : UInt,
|
||||
) -> Unit {
|
||||
match ev {
|
||||
Modifiers(dep, lat, lock, group) => {
|
||||
self.mods_latched = lat
|
||||
@@ -2319,7 +2429,7 @@ fn ChandraCompositor::handle_input_inner(
|
||||
self.ptr_grab = false
|
||||
self.grab_buttons = 0
|
||||
self.press_fwd = false
|
||||
self.handle_input(PointerMove(self.ptr_x, self.ptr_y), time_ms)
|
||||
self.dispatch_input_inner(PointerMove(self.ptr_x, self.ptr_y), time_ms)
|
||||
}
|
||||
}
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user