diff --git a/kitty/mouse.c b/kitty/mouse.c index cbe6a5919..706a1e52f 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -902,6 +902,14 @@ mouse_event(const int button, int modifiers, int action) { } } w = window_for_event(&window_idx, &in_tab_bar); + if (global_state.mouse_hover_in_window) { + Window *old_window = window_for_id(global_state.mouse_hover_in_window); + if (old_window && old_window != w) { + global_state.mouse_hover_in_window = 0; + screen_mark_url(old_window->render_data.screen, 0, 0, 0, 0); + } + } + if (in_tab_bar) { mouse_cursor_shape = POINTER_POINTER; handle_tab_bar_mouse(button, modifiers, action); diff --git a/kitty/shaders.c b/kitty/shaders.c index 1d1568f40..0cdb1101e 100644 --- a/kitty/shaders.c +++ b/kitty/shaders.c @@ -814,7 +814,7 @@ render_a_bar(const UIRenderData *ui, WindowBarData *bar, PyObject *title, bool a static bool has_hyperlink_target(OSWindow *os_window, Window *w, Screen *screen) { - return OPT(show_hyperlink_targets) && screen->current_hyperlink_under_mouse.id && w && !is_mouse_hidden(os_window); + return OPT(show_hyperlink_targets) && screen->current_hyperlink_under_mouse.id && w && !is_mouse_hidden(os_window) && global_state.mouse_hover_in_window == w->id; } static void