Emoji picker (Super+.): search, tabs, skin tones, recents, text-input-v3 insertion
CI / test (push) Canceled after 0s

Compositor-drawn Win+. style picker. The focused app keeps keyboard focus so
its text-input-v3 field stays enabled; the emoji goes in with commit_string,
or onto the clipboard with a visible notice when the app has no text field.
Shortcut lives in the shortcut table (rebindable in Settings > Shortcuts).

- compositor/wayland/text_input.mbt: zwp_text_input_manager_v3 (global 12)
- compositor/emoji: Emoji 18.0 + CLDR 49 data (Unicode License), search,
  picker model, CBDT/CBLC + GSUB reader for Noto Color Emoji
- Chandra's own pinned bitmap Noto Color Emoji (scripts/fetch-emoji-font.sh,
  just emoji-font); Fedora's COLRv1 copy can't be drawn. Missing font shows
  an error panel.
- raster WIT: emoji-font, emoji-has, emoji-image; served by wasmhost
- state.edn :emoji {:recent [...] :skin-tone n}
- tests incl. a fake text-input client; docs/emoji-picker.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkABDGJixotaqFv2X2
This commit is contained in:
Claude committed 2026-11-26 07:00:22 +00:00
1 parent 738928352e
commit 27252a97ab
39 files changed
+4942 -41

No files matched your search

+22 -1
View File
@@ -103,6 +103,9 @@ enum ObjKind {
ObjPrimaryOffer(UInt, UInt)
ObjCursorShapeMgr
ObjCursorShapeDev
/// zwp_text_input_manager_v3 and its zwp_text_input_v3 objects (text_input.mbt).
ObjTextInputMgr
ObjTextInput
}
///|
@@ -241,6 +244,8 @@ struct ClientConn {
mut next_offer : UInt
/// wp_cursor_shape_v1 shape the client last asked for (0 = never set).
mut cursor_shape : UInt
/// zwp_text_input_v3 objects, by id (text_input.mbt).
text_inputs : Map[UInt, TextInputState]
mut alive : Bool
}
@@ -272,6 +277,7 @@ fn ClientConn::new(client_id : UInt, fd : Int) -> ClientConn {
source_actions: {},
next_offer: 0xff000000U,
cursor_shape: 0U,
text_inputs: {},
alive: true,
}
}
@@ -345,6 +351,9 @@ pub(all) struct WaylandServer {
mut primary : (UInt, UInt)?
/// Client that currently has keyboard focus (receives selection events).
mut kbd_client : UInt?
/// The surface with keyboard focus: (client id, wl_surface id). Text inputs created while it
/// has focus are told so at once.
mut kbd_surface : (UInt, UInt)?
/// Area a popup must stay inside, as (x, y, w, h) relative to its parent's content origin
/// (the parent window id is passed). The host sets this; the default never constrains.
mut popup_bounds : (UInt64) -> (Int, Int, Int, Int)
@@ -388,6 +397,7 @@ pub fn WaylandServer::listen(
keymap: Bytes::from_array([]),
selection: None,
kbd_client: None,
kbd_surface: None,
primary: None,
popup_bounds: fn(_) { (-1000000, -1000000, 2000000, 2000000) },
own_mimes: [],
@@ -460,6 +470,7 @@ fn emit_registry_globals(c : ClientConn, reg_id : UInt) -> Unit {
(9U, "wp_cursor_shape_manager_v1", 1U),
(10U, "org_kde_kwin_server_decoration_manager", 1U),
(11U, "zwp_primary_selection_device_manager_v1", 1U),
(12U, "zwp_text_input_manager_v3", 1U),
]
for g in globals {
let w = WireWriter::new()
@@ -680,6 +691,8 @@ fn WaylandServer::dispatch_msg(
c.data_ver = ver
} else if iface == "zwp_primary_selection_device_manager_v1" {
c.objects.set(new_id, ObjPrimaryManager)
} else if iface == "zwp_text_input_manager_v3" {
c.objects.set(new_id, ObjTextInputMgr)
} else if iface == "wl_subcompositor" {
c.objects.set(new_id, ObjSubcompositor)
} else if iface == "wl_output" {
@@ -1072,6 +1085,7 @@ fn WaylandServer::dispatch_msg(
let id = reader.u32()
c.objects.set(id, ObjCursorShapeDev)
}
ObjTextInputMgr | ObjTextInput => self.text_input_request(c, kind, obj_id, opcode, reader)
ObjCursorShapeDev =>
if opcode == 1U {
// set_shape(serial, shape)
@@ -2058,6 +2072,7 @@ pub fn WaylandServer::keyboard_enter(self : WaylandServer, win_id : UInt64) -> U
None => ()
Some((c, tl)) => {
self.kbd_client = Some(c.client_id)
self.kbd_surface = Some((c.client_id, tl.wl_surface_id))
self.send_selection(c)
self.send_primary(c)
for kid in c.keyboard_ids {
@@ -2067,6 +2082,7 @@ pub fn WaylandServer::keyboard_enter(self : WaylandServer, win_id : UInt64) -> U
w.array([])
c.send_msg(w.finish_msg(kid, 1U))
}
text_inputs_enter(c, tl.wl_surface_id)
}
}
}
@@ -2075,13 +2091,18 @@ pub fn WaylandServer::keyboard_enter(self : WaylandServer, win_id : UInt64) -> U
pub fn WaylandServer::keyboard_leave(self : WaylandServer, win_id : UInt64) -> Unit {
match self.win_client(win_id) {
None => ()
Some((c, tl)) =>
Some((c, tl)) => {
for kid in c.keyboard_ids {
let w = WireWriter::new()
w.u32(self.next_serial())
w.u32(tl.wl_surface_id)
c.send_msg(w.finish_msg(kid, 2U))
}
text_inputs_leave(c, tl.wl_surface_id)
if self.kbd_surface == Some((c.client_id, tl.wl_surface_id)) {
self.kbd_surface = None
}
}
}
}