CI / test (push) Canceled after 0s
- Add compositor/shell/backlight.mbt for backlight control in the shell - Update wit/capabilities.wit and wit/host/plasmoids.wit, then regenerate the component and interface ffi.mbt bindings (mostly export reordering) - Add world/launcher-widget/README.md
48 lines
5.4 KiB
Markdown
48 lines
5.4 KiB
Markdown
# Handset & Touch Support
|
|
|
|
Chandra includes KMS/libinput/compositor adaptations tailored for mainline Linux smartphones (verified on OnePlus 6T `oneplus,fajita` at `1080x2340`).
|
|
|
|
## Display Scaling (`CHANDRA_SCALE`)
|
|
|
|
- Integer scaling lives in [`compositor/kms/kms_stub.c`](../compositor/kms/kms_stub.c).
|
|
- Setting `CHANDRA_SCALE=N` (or the default automatic `2x` scaling on dense portrait phone panels such as `1080x2340`) runs the compositor at a legible `540x1170` logical resolution while presenting `Nx` nearest pixels to hardware dumb buffers and cursor planes.
|
|
|
|
## Icon Desktop & Compact Panel
|
|
|
|
- **Icon desktop default:** Portrait handset layouts prioritize the touch-friendly icon desktop launcher aesthetic.
|
|
- **Compact panel layout:** Panel items (`launcher`, `dock`, `session-settings`, `network`, `battery`, `clock-digital`, `screenshot`) size compactly so all controls fit cleanly within `540px` portrait width without clipping, with fuel-gauge support (e.g. `bq27411-0`).
|
|
|
|
## Touch Input & On-Screen Keyboard
|
|
|
|
- **Long-press right-click:** In [`compositor/kms/kms_stub.c`](../compositor/kms/kms_stub.c), a stationary touch held for `500 ms` converts to a synthetic right-click (`BTN_RIGHT`) via a `timerfd`, allowing context menus and secondary actions without a mouse.
|
|
- **Built-in OSK:** [`compositor/host/osk.mbt`](../compositor/host/osk.mbt) provides a 5-row virtual keyboard that opens automatically when Wayland text input (`zwp_text_input_v3`) gains focus and can also be toggled manually from the bottom-right **`KB`** pill.
|
|
|
|
## Display Rotation, Flip, and Auto-Rotate
|
|
|
|
- **4-way transform (`0°`, `90° CW`, `180°`, `270° CW`):** Handled end-to-end across [`compositor/kms/kms_stub.c`](../compositor/kms/kms_stub.c), [`wit/host/display.wit`](../wit/host/display.wit), [`wasmhost/bin/display.mbt`](../wasmhost/bin/display.mbt), and the compositor event loop (`CHANDRA_ROTATE` sets the initial orientation). Both scanout rows and libinput touch/pointer coordinates transform to match the active orientation.
|
|
- **Touch `Rot` pill:** Sitting left of the `KB` pill in [`compositor/host/osk.mbt`](../compositor/host/osk.mbt):
|
|
- **Tap:** rotate `90°` clockwise (`0 -> 90 -> 180 -> 270 -> 0`).
|
|
- **Long-press / right-click:** flip `180°` (`0 <-> 180`, `90 <-> 270`).
|
|
- **CLI control:** `chandra-ctl rotate [cw|ccw|flip|0|90|180|270|status]` queries or changes rotation live (`0` portrait, `90` / `270` landscape, `180` inverted).
|
|
- **Sensor auto-rotate:** When running on the DRM backend (`chandra-session`) with `monitor-sensor` (`iio-sensor-proxy`) installed, [`session/chandra-auto-rotate`](../session/chandra-auto-rotate) runs inside the active `seat0` session and applies orientation change events (`normal -> 0`, `right-up -> 90`, `bottom-up -> 180`, `left-up -> 270`) without fighting manual `Rot` taps while stationary. Set `CHANDRA_AUTO_ROTATE=0` in the session environment to disable auto-rotate.
|
|
|
|
## Client-Side Window Controls (Chromium / GTK)
|
|
|
|
- [`compositor/wayland/server.mbt`](../compositor/wayland/server.mbt) emits `xdg_toplevel.wm_capabilities` (`window_menu`, `maximize`, `fullscreen`, `minimize`) for `xdg_wm_base` v5+ clients so client-decorated apps expose Maximize alongside Close.
|
|
- On GTK/Chromium setups where GNOME defaults (`org.gnome.desktop.wm.preferences button-layout`) omit maximize/minimize (e.g. `'appmenu:close'`), configure GTK and `gsettings`:
|
|
- `~/.config/gtk-3.0/settings.ini` and `~/.config/gtk-4.0/settings.ini`: `gtk-decoration-layout=:minimize,maximize,close`
|
|
- `gsettings set org.gnome.desktop.wm.preferences button-layout ':minimize,maximize,close'`
|
|
|
|
## Keyring Unlock
|
|
|
|
- [`session/chandra-session`](../session/chandra-session) starts `gnome-keyring-daemon --start --components=secrets` and unlocks an unencrypted default `login.keyring` at login over D-Bus (`org.freedesktop.Secret.Service.Unlock`) so apps such as Chromium store credentials without blocking prompts.
|
|
|
|
## Power Button & Brightness
|
|
|
|
- **Power key blank/wake:** Pressing `KEY_POWER` (`116`) in [`compositor/host/compositor.mbt`](../compositor/host/compositor.mbt) toggles manual screen blanking (`DPMS` off/on + touch cancellation in [`compositor/kms/kms_stub.c`](../compositor/kms/kms_stub.c)) while ignoring stray touches during blanking. Also controllable via `chandra-ctl screen [on|off|toggle|status]`. (Set `HandlePowerKey=ignore` in `/etc/systemd/logind.conf.d/` so `logind` does not power off immediately.)
|
|
- **Settings Brightness slider:** [`compositor/shell/backlight.mbt`](../compositor/shell/backlight.mbt) reads `/sys/class/backlight/` (`ae94000.dsi.0`, `CHANDRA_BACKLIGHT` override) and writes changes via sysfs or `org.freedesktop.login1.Session.SetBrightness`. When a backlight device exists, **Settings > Power > Brightness** shows a `-` / slider / `+` control (`5%..100%`), also accessible via `chandra-ctl brightness [PCT|status]`.
|
|
|
|
## Face Unlock (`libcamera`)
|
|
|
|
- On phones whose MIPI sensors (`imx371`, `imx519`, `imx376`) require `libcamera` SoftISP rather than raw V4L2 nodes, [`face/chandra-face`](../face/chandra-face) supports `libcamera:<camera-id>` entries via `python-libcamera` and applies `libcamera.properties.Rotation`. [`face/install.py`](../face/install.py) supports `--system-python` to run with system `python-opencv` + `python-numpy` on `aarch64`, and [`face/polkit-agent-helper.conf`](../face/polkit-agent-helper.conf) grants `char-video4linux`, `char-media`, and `char-dma_heap` access to polkit's helper sandbox.
|