From 614a9775c62972047537835081c27231a93f5e61 Mon Sep 17 00:00:00 2001 From: Nathan Fisher Date: Sat, 30 Sep 2023 18:26:40 -0400 Subject: [PATCH 1/2] Set the mouse pointer to "text" (an I-beam) when it is over the gl_area which the terminal embeds into for the Gtk interface. Addresses https://github.com/mitchellh/ghostty/issues/596 --- src/apprt/gtk/Window.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/apprt/gtk/Window.zig b/src/apprt/gtk/Window.zig index c956ffd7f..3b5e8a17f 100644 --- a/src/apprt/gtk/Window.zig +++ b/src/apprt/gtk/Window.zig @@ -226,6 +226,7 @@ pub fn newTab(self: *Window, parent_: ?*CoreSurface) !void { // wait for the "realize" callback from GTK to know that the OpenGL // context is ready. See Surface docs for more info. const gl_area = c.gtk_gl_area_new(); + c.gtk_widget_set_cursor_from_name(gl_area, "text"); try surface.init(self.app, .{ .window = self, .gl_area = @ptrCast(gl_area), From abf43ddfcca1cfc85b872e1f06dbea8b5d89adb2 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 30 Sep 2023 15:46:03 -0700 Subject: [PATCH 2/2] apprt/gtk: change default cursor to text --- src/apprt/gtk/Surface.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/apprt/gtk/Surface.zig b/src/apprt/gtk/Surface.zig index 1e6bc907e..b66c053e9 100644 --- a/src/apprt/gtk/Surface.zig +++ b/src/apprt/gtk/Surface.zig @@ -85,6 +85,7 @@ im_len: u7 = 0, pub fn init(self: *Surface, app: *App, opts: Options) !void { const widget = @as(*c.GtkWidget, @ptrCast(opts.gl_area)); + c.gtk_widget_set_cursor_from_name(@ptrCast(opts.gl_area), "text"); c.gtk_gl_area_set_required_version(opts.gl_area, 3, 3); c.gtk_gl_area_set_has_stencil_buffer(opts.gl_area, 0); c.gtk_gl_area_set_has_depth_buffer(opts.gl_area, 0); @@ -355,7 +356,7 @@ pub fn setMouseShape( shape: terminal.MouseShape, ) !void { const name: [:0]const u8 = switch (shape) { - .default => "default", + .default => "text", .help => "help", .pointer => "pointer", .context_menu => "context-menu",