termio: only change mouse shape if it is changing

Fixes #976
This commit is contained in:
Mitchell Hashimoto
2023-12-01 19:35:18 -08:00
parent a8c8dcdd98
commit 516edf1506

View File

@ -2135,6 +2135,10 @@ const StreamHandler = struct {
self: *StreamHandler, self: *StreamHandler,
shape: terminal.MouseShape, shape: terminal.MouseShape,
) !void { ) !void {
// Avoid changing the shape it it is already set to avoid excess
// cross-thread messaging.
if (self.terminal.mouse_shape == shape) return;
self.terminal.mouse_shape = shape; self.terminal.mouse_shape = shape;
_ = self.ev.surface_mailbox.push(.{ _ = self.ev.surface_mailbox.push(.{
.set_mouse_shape = shape, .set_mouse_shape = shape,