fix: dispatch flush events to both input and event handlers

This commit is contained in:
CJ van den Berg 2024-11-17 23:31:46 +01:00
parent e172590ba8
commit e9f170372d
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -409,8 +409,9 @@ fn active_event_handler(self: *Self) ?EventHandler {
fn dispatch_flush_input_event(self: *Self) !void { fn dispatch_flush_input_event(self: *Self) !void {
var buf: [32]u8 = undefined; var buf: [32]u8 = undefined;
if (self.active_event_handler()) |eh| const mode = self.input_mode orelse return;
try eh.send(tp.self_pid(), try tp.message.fmtbuf(&buf, .{"F"})); try mode.input_handler.send(tp.self_pid(), try tp.message.fmtbuf(&buf, .{"F"}));
if (mode.event_handler) |eh| try eh.send(tp.self_pid(), try tp.message.fmtbuf(&buf, .{"F"}));
} }
fn dispatch_input(ctx: *anyopaque, cbor_msg: []const u8) void { fn dispatch_input(ctx: *anyopaque, cbor_msg: []const u8) void {