From 3cb8417699dc8d1b720c953dc7ad3a31d1741d3a Mon Sep 17 00:00:00 2001 From: nandithebull Date: Tue, 24 Nov 2026 18:40:24 -0800 Subject: [PATCH] Compositor: advertise wl_subcompositor and wl_data_device_manager so real clients (foot) load Co-Authored-By: Claude Sonnet 5.5 --- compositor/wayland/server.mbt | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/compositor/wayland/server.mbt b/compositor/wayland/server.mbt index b2269df..92c63e7 100644 --- a/compositor/wayland/server.mbt +++ b/compositor/wayland/server.mbt @@ -34,6 +34,10 @@ enum ObjKind { ObjKeyboard ObjTouch ObjOutput + ObjSubcompositor + ObjSubsurface + ObjDataManager + ObjDataObj } ///| @@ -205,6 +209,8 @@ fn emit_registry_globals(c : ClientConn, reg_id : UInt) -> Unit { (4U, "zxdg_decoration_manager_v1", 1U), (5U, "wl_seat", 7U), (6U, "wl_output", 4U), + (7U, "wl_subcompositor", 1U), + (8U, "wl_data_device_manager", 3U), ] for g in globals { let w = WireWriter::new() @@ -370,6 +376,10 @@ fn WaylandServer::dispatch_msg( } else if iface == "wl_seat" { c.objects.set(new_id, ObjSeat) emit_seat_info(c, new_id) + } else if iface == "wl_data_device_manager" { + c.objects.set(new_id, ObjDataManager) + } else if iface == "wl_subcompositor" { + c.objects.set(new_id, ObjSubcompositor) } else if iface == "wl_output" { c.objects.set(new_id, ObjOutput) emit_output_info(c, new_id, self.output_w, self.output_h) @@ -461,6 +471,28 @@ fn WaylandServer::dispatch_msg( } } } + ObjSubcompositor => + if opcode == 0U { + // destroy + c.objects.remove(obj_id) + send_delete_id(c, obj_id) + } else if opcode == 1U { + // get_subsurface(id: new_id, surface, parent): accepted, not composited yet + let sub_id = reader.u32() + c.objects.set(sub_id, ObjSubsurface) + } + ObjDataManager => + if opcode == 0U || opcode == 1U { + // create_data_source / get_data_device: accepted, no selection support yet + let id = reader.u32() + c.objects.set(id, ObjDataObj) + } + ObjDataObj => () + ObjSubsurface => + if opcode == 0U { + c.objects.remove(obj_id) + send_delete_id(c, obj_id) + } ObjShm => if opcode == 0U { // create_pool(id: new_id, fd: out-of-band, size: i32)