mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
Merge pull request #2310 from ghostty-org/macos-bug
Action system fixups
This commit is contained in:
@ -379,9 +379,9 @@ typedef struct {
|
|||||||
|
|
||||||
// apprt.action.GotoTab
|
// apprt.action.GotoTab
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GHOSTTY_GOTO_TAB_PREVIOUS,
|
GHOSTTY_GOTO_TAB_PREVIOUS = -1,
|
||||||
GHOSTTY_GOTO_TAB_NEXT,
|
GHOSTTY_GOTO_TAB_NEXT = -2,
|
||||||
GHOSTTY_GOTO_TAB_LAST,
|
GHOSTTY_GOTO_TAB_LAST = -3,
|
||||||
} ghostty_action_goto_tab_e;
|
} ghostty_action_goto_tab_e;
|
||||||
|
|
||||||
// apprt.action.Fullscreen
|
// apprt.action.Fullscreen
|
||||||
|
@ -734,7 +734,7 @@ class TerminalController: NSWindowController, NSWindowDelegate,
|
|||||||
// Get the tab index from the notification
|
// Get the tab index from the notification
|
||||||
guard let tabEnumAny = notification.userInfo?[Ghostty.Notification.GotoTabKey] else { return }
|
guard let tabEnumAny = notification.userInfo?[Ghostty.Notification.GotoTabKey] else { return }
|
||||||
guard let tabEnum = tabEnumAny as? ghostty_action_goto_tab_e else { return }
|
guard let tabEnum = tabEnumAny as? ghostty_action_goto_tab_e else { return }
|
||||||
let tabIndex: Int32 = .init(bitPattern: tabEnum.rawValue)
|
let tabIndex: Int32 = tabEnum.rawValue
|
||||||
|
|
||||||
guard let windowController = window.windowController else { return }
|
guard let windowController = window.windowController else { return }
|
||||||
guard let tabGroup = windowController.window?.tabGroup else { return }
|
guard let tabGroup = windowController.window?.tabGroup else { return }
|
||||||
|
@ -139,7 +139,7 @@ pub fn addSurface(self: *App, rt_surface: *apprt.Surface) !void {
|
|||||||
// It is up to the apprt if there is a quit timer at all and if it
|
// It is up to the apprt if there is a quit timer at all and if it
|
||||||
// should be canceled.
|
// should be canceled.
|
||||||
rt_surface.app.performAction(
|
rt_surface.app.performAction(
|
||||||
.{ .surface = &rt_surface.core_surface },
|
.app,
|
||||||
.quit_timer,
|
.quit_timer,
|
||||||
.stop,
|
.stop,
|
||||||
) catch |err| {
|
) catch |err| {
|
||||||
@ -173,7 +173,7 @@ pub fn deleteSurface(self: *App, rt_surface: *apprt.Surface) void {
|
|||||||
// If we have no surfaces, we can start the quit timer. It is up to the
|
// If we have no surfaces, we can start the quit timer. It is up to the
|
||||||
// apprt to determine if this is necessary.
|
// apprt to determine if this is necessary.
|
||||||
if (self.surfaces.items.len == 0) rt_surface.app.performAction(
|
if (self.surfaces.items.len == 0) rt_surface.app.performAction(
|
||||||
.{ .surface = &rt_surface.core_surface },
|
.app,
|
||||||
.quit_timer,
|
.quit_timer,
|
||||||
.start,
|
.start,
|
||||||
) catch |err| {
|
) catch |err| {
|
||||||
|
@ -1257,14 +1257,10 @@ pub fn setFontSize(self: *Surface, size: font.face.DesiredSize) !void {
|
|||||||
errdefer self.app.font_grid_set.deref(font_grid_key);
|
errdefer self.app.font_grid_set.deref(font_grid_key);
|
||||||
|
|
||||||
// Set our cell size
|
// Set our cell size
|
||||||
try self.rt_app.performAction(
|
try self.setCellSize(.{
|
||||||
.{ .surface = self },
|
.width = font_grid.metrics.cell_width,
|
||||||
.cell_size,
|
.height = font_grid.metrics.cell_height,
|
||||||
.{
|
});
|
||||||
.width = font_grid.metrics.cell_width,
|
|
||||||
.height = font_grid.metrics.cell_height,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
// Notify our render thread of the new font stack. The renderer
|
// Notify our render thread of the new font stack. The renderer
|
||||||
// MUST accept the new font grid and deref the old.
|
// MUST accept the new font grid and deref the old.
|
||||||
|
@ -441,6 +441,11 @@ pub const App = struct {
|
|||||||
else => {},
|
else => {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.debug("dispatching action target={s} action={} value={}", .{
|
||||||
|
@tagName(target),
|
||||||
|
action,
|
||||||
|
value,
|
||||||
|
});
|
||||||
self.opts.action(
|
self.opts.action(
|
||||||
self,
|
self,
|
||||||
target.cval(),
|
target.cval(),
|
||||||
|
Reference in New Issue
Block a user