Skip to content

Commit

Permalink
fix memoryview TypeError on MS Windows with lz4 raw cursor data
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Nov 24, 2022
1 parent ad4f411 commit 095e108
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xpra/client/gtk_base/gtk_client_base.py
Expand Up @@ -21,6 +21,7 @@
from xpra.os_util import (
bytestostr, strtobytes, hexstr, load_binary_file, osexpand,
WIN32, OSX, POSIX, is_Wayland,
memoryview_to_bytes,
)
from xpra.common import FULL_INFO
from xpra.simple_stats import std_unit
Expand Down Expand Up @@ -1020,7 +1021,7 @@ def make_cursor(self, cursor_data):
if w<=fw and h<=fh:
cursorlog("pasting %ix%i cursor to fixed OS size %ix%i", w, h, fw, fh)
from PIL import Image # @UnresolvedImport
img = Image.frombytes("RGBA", (w, h), pixels, "raw", "BGRA", w*4, 1)
img = Image.frombytes("RGBA", (w, h), memoryview_to_bytes(pixels), "raw", "BGRA", w*4, 1)
target = Image.new("RGBA", (fw, fh))
target.paste(img, (0, 0, w, h))
pixels = target.tobytes("raw", "BGRA")
Expand Down

0 comments on commit 095e108

Please sign in to comment.