mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 07:46:12 +03:00
Prevent hyperlink hover state when mouse is outside viewport
This commit is contained in:
@ -1041,6 +1041,9 @@ fn mouseRefreshLinks(
|
||||
pos_vp: terminal.point.Coordinate,
|
||||
over_link: bool,
|
||||
) !void {
|
||||
// If the position is outside our viewport, do nothing
|
||||
if (pos.x < 0 or pos.y < 0) return;
|
||||
|
||||
self.mouse.link_point = pos_vp;
|
||||
|
||||
if (try self.linkAtPos(pos)) |link| {
|
||||
|
@ -638,7 +638,7 @@ pub const Surface = struct {
|
||||
.y = @floatCast(opts.scale_factor),
|
||||
},
|
||||
.size = .{ .width = 800, .height = 600 },
|
||||
.cursor_pos = .{ .x = 0, .y = 0 },
|
||||
.cursor_pos = .{ .x = -1, .y = -1 },
|
||||
.keymap_state = .{},
|
||||
};
|
||||
|
||||
|
@ -560,7 +560,7 @@ pub fn init(self: *Surface, app: *App, opts: Options) !void {
|
||||
.font_size = font_size,
|
||||
.init_config = init_config,
|
||||
.size = .{ .width = 800, .height = 600 },
|
||||
.cursor_pos = .{ .x = 0, .y = 0 },
|
||||
.cursor_pos = .{ .x = -1, .y = -1 },
|
||||
.im_context = im_context,
|
||||
.cgroup_path = cgroup_path,
|
||||
};
|
||||
|
Reference in New Issue
Block a user