mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-18 21:40:29 +00:00
feat: add readonly surface mode (#9130)
Tried my hand at #8432 Currently lacking tests and some sort of visual indicator that the surface is locked. Also, not entirely sure if I needed to touch `application.zig`. Found what needed changing with help from Copilot (and added Docs w/ Copilot), but wrote most of the code myself.
This commit is contained in:
@@ -22,6 +22,9 @@ const configpkg = @import("../config.zig");
|
||||
|
||||
const log = std.log.scoped(.io_exec);
|
||||
|
||||
/// Mutex state argument for queueMessage.
|
||||
pub const MutexState = enum { locked, unlocked };
|
||||
|
||||
/// Allocator
|
||||
alloc: Allocator,
|
||||
|
||||
@@ -380,7 +383,7 @@ pub fn threadExit(self: *Termio, data: *ThreadData) void {
|
||||
pub fn queueMessage(
|
||||
self: *Termio,
|
||||
msg: termio.Message,
|
||||
mutex: enum { locked, unlocked },
|
||||
mutex: MutexState,
|
||||
) void {
|
||||
self.mailbox.send(msg, switch (mutex) {
|
||||
.locked => self.renderer_state.mutex,
|
||||
|
||||
Reference in New Issue
Block a user