From: Ian Jackson Date: Mon, 13 Jun 2022 00:26:19 +0000 (+0100) Subject: script: Fiddle with CSS to try to get cursor to update X-Git-Tag: otter-1.2.0~23 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=16e280910f8db6030b2d3714ea6263384ee38de6;p=otter.git script: Fiddle with CSS to try to get cursor to update Signed-off-by: Ian Jackson --- 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(); }