From e70ec5d5f4bbd788e13b4dfb6548a981fd855d2d Mon Sep 17 00:00:00 2001 From: Matt Robenolt Date: Fri, 26 Jan 2024 20:52:00 -0800 Subject: [PATCH] Only detect links when Super is held down This stops underlining and changing to a pointer unless Cmd or Ctrl is held down already. --- src/Surface.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Surface.zig b/src/Surface.zig index ecce0a109..c8fb2448e 100644 --- a/src/Surface.zig +++ b/src/Surface.zig @@ -2008,7 +2008,7 @@ pub fn mouseButtonCallback( // Handle link clicking. We want to do this before we do mouse // reporting or any other mouse handling because a successfully // clicked link will swallow the event. - if (button == .left and action == .release and mods.super and self.mouse.over_link) { + if (button == .left and action == .release and mods.ctrlOrSuper() and self.mouse.over_link) { const pos = try self.rt_surface.getCursorPos(); if (self.processLinks(pos)) |processed| { if (processed) return; @@ -2238,6 +2238,9 @@ fn linkAtPos( // If we have no configured links we can save a lot of work if (self.config.links.len == 0) return null; + // Require super to be held down, so bail early + if (!self.mouse.mods.ctrlOrSuper()) return null; + // Convert our cursor position to a screen point. const mouse_pt = mouse_pt: { const viewport_point = self.posToViewport(pos.x, pos.y);