From 524fcf7bf10441f64ce90b207df18c564a8012d1 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Mon, 14 Oct 2019 07:11:09 +0000 Subject: [PATCH] also scale cursors we load by name git-svn-id: https://xpra.org/svn/Xpra/trunk@24131 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/client/gtk_base/gtk_client_base.py | 28 +++++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/xpra/client/gtk_base/gtk_client_base.py b/src/xpra/client/gtk_base/gtk_client_base.py index f2bea0900e..d2d93e6c4d 100644 --- a/src/xpra/client/gtk_base/gtk_client_base.py +++ b/src/xpra/client/gtk_base/gtk_client_base.py @@ -812,16 +812,17 @@ def make_cursor(self, cursor_data): display = Gdk.Display.get_default() cursorlog("make_cursor: has-name=%s, has-cursor-types=%s, xscale=%s, yscale=%s, USE_LOCAL_CURSORS=%s", len(cursor_data)>=10, bool(cursor_types), self.xscale, self.yscale, USE_LOCAL_CURSORS) - #named cursors cannot be scaled - #(round to 10 to compare so 0.95 and 1.05 are considered the same as 1.0, no scaling): - if len(cursor_data)>=10 and cursor_types and iround(self.xscale*10)==10 and iround(self.yscale*10)==10: + pixbuf = None + if len(cursor_data)>=10 and cursor_types: cursor_name = bytestostr(cursor_data[9]) if cursor_name and USE_LOCAL_CURSORS: gdk_cursor = cursor_types.get(cursor_name.upper()) if gdk_cursor is not None: - cursorlog("setting new cursor by name: %s=%s", cursor_name, gdk_cursor) try: - return Gdk.Cursor.new_for_display(display, gdk_cursor) + cursor = Gdk.Cursor.new_for_display(display, gdk_cursor) + cursorlog("Cursor.new_for_display(%s, %s)=%s", display, gdk_cursor, cursor) + pixbuf = cursor.get_image() + cursorlog("image=%s", pixbuf) except TypeError as e: log("new_Cursor_for_display(%s, %s)", display, gdk_cursor, exc_info=True) if first_time("cursor:%s" % cursor_name.upper()): @@ -836,12 +837,17 @@ def make_cursor(self, cursor_data): if encoding!="raw": cursorlog.warn("Warning: invalid cursor encoding: %s", encoding) return None - if len(pixels)