From 16e280910f8db6030b2d3714ea6263384ee38de6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 13 Jun 2022 01:26:19 +0100 Subject: [PATCH] script: Fiddle with CSS to try to get cursor to update Signed-off-by: Ian Jackson --- templates/script.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/templates/script.ts b/templates/script.ts index e28b4dd5..2d2cb56f 100644 --- a/templates/script.ts +++ b/templates/script.ts @@ -595,16 +595,17 @@ function mousecursor_etc_reupdate() { `; } } + // Empirically, setting this to '' and then back to the SVG data + // seems to cause Firefox to update it more promptly. + style_elem.innerHTML = ''; if (svg !== undefined) { let svg_data = btoa(svg); style_text = `svg[id=space] { cursor: url(data:image/svg+xml;base64,${svg_data}) ${xy}, auto; }`; - } else { - style_text = ''; + style_elem.innerHTML = style_text; } - style_elem.innerHTML = style_text; recompute_keybindings(); } -- 2.30.2