<div dir="ltr">A very small patch to handle cursor caching in spice-html. Indeed until now the cursor shape wasn't cached so it appeared correctly only once.<br>Independently from that I didn’t see my latest contribution to spice-html5 from January 22 in the git repository (<a href="http://cgit.freedesktop.org/spice/spice-html5/">http://cgit.freedesktop.org/spice/spice-html5/</a>, correct?). Did I something wrong?<br>
<br>Cheers,<br>Vincent<br><br><br>Signed-off-by: Vincent Desprez <<a href="mailto:vincent.desprez@apwise.com">vincent.desprez@apwise.com</a>><br>---<br> cursor.js | 13 +++++++++++--<br> 1 files changed, 11 insertions(+), 2 deletions(-)<br>
<br>diff --git a/cursor.js b/cursor.js<br>index e3f6e0e..fc8abe7 100644<br>--- a/cursor.js<br>+++ b/cursor.js<br>@@ -59,7 +59,7 @@ SpiceCursorConn.prototype.process_channel_message = function(msg)<br> return true;<br>
}<br> <br>- if (cursor_set.flags > 0)<br>+ if (cursor_set.flags == 1)<br> this.log_warn("FIXME: No support for cursor flags " + cursor_set.flags);<br> <br> if (cursor_set.cursor.header.type != SPICE_CURSOR_TYPE_ALPHA)<br>
@@ -83,9 +83,18 @@ SpiceCursorConn.prototype.process_channel_message = function(msg)<br> return false;<br> }<br> <br>+<br>+SpiceCursorConn.cursor_cache = [];<br> SpiceCursorConn.prototype.set_cursor = function(cursor)<br>
{<br>- var pngstr = create_rgba_png(cursor.header.height, cursor.header.width, cursor.data);<br>+ if (cursor.flags == 4)<br>+ var pngstr = SpiceCursorConn.cursor_cache[cursor.header.unique[0]];<br>+ else<br>
+ var pngstr = create_rgba_png(cursor.header.height, cursor.header.width, cursor.data);<br>+<br>+ if (cursor.flags == 2)<br>+ SpiceCursorConn.cursor_cache[cursor.header.unique[0]] = pngstr;<br>+<br> var curstr = 'url(data:image/png,' + pngstr + ') ' + <br>
cursor.header.hot_spot_x + ' ' + cursor.header.hot_spot_y + ", default";<br> document.getElementById(this.parent.screen_id).style.cursor = curstr;<br><div>
</div></div>