summaryrefslogtreecommitdiff
path: root/src/tty/tty.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/tty/tty.zig')
-rw-r--r--src/tty/tty.zig14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/tty/tty.zig b/src/tty/tty.zig
index 0b933065..67807cd5 100644
--- a/src/tty/tty.zig
+++ b/src/tty/tty.zig
@@ -1469,8 +1469,11 @@ const Shell = struct {
core.quit = true;
return true;
},
- .focus_in => {},
- .focus_out => core.update(.pointer_leave),
+ .focus_in => core.update(.{ .focus = true }),
+ .focus_out => {
+ core.update(.pointer_leave);
+ core.update(.{ .focus = false });
+ },
.winsize => |ws| {
s.vx.resize(s.gpa, s.tty.writer(), ws) catch {};
if (comptime pardes.pdf_enabled)
@@ -2674,8 +2677,11 @@ const Attach = struct {
switch (event) {
.nop, .wake, .fs_ready, .lsp_done, .lsp_status, .pipe_done, .pty_read, .pty_eof, .files_changed => {},
.quit => return .none,
- .focus_in => {},
- .focus_out => return a.send(.pointer_leave),
+ .focus_in => return a.send(.{ .focus = true }),
+ .focus_out => {
+ if (a.send(.pointer_leave)) |end| return end;
+ return a.send(.{ .focus = false });
+ },
.winsize => |ws| {
a.vx.resize(a.gpa, a.tty.writer(), ws) catch {};
a.dirty = true;