Skip to content

Commit

Permalink
fix win32 icon (use correct dimensions for resizing) and enable dynam…
Browse files Browse the repository at this point in the history
…ic tray there, better debug logging

git-svn-id: https://xpra.org/svn/Xpra/trunk@17765 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Dec 27, 2017
1 parent cd4d4a5 commit 806e6b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def add_legacy_names(codecs):
RPC_TIMEOUT = envint("XPRA_RPC_TIMEOUT", 5000)

TRAY_DELAY = envint("XPRA_TRAY_DELAY", 0)
DYNAMIC_TRAY_ICON = envbool("XPRA_DYNAMIC_TRAY_ICON", not OSX and not WIN32 and not is_Ubuntu())
DYNAMIC_TRAY_ICON = envbool("XPRA_DYNAMIC_TRAY_ICON", not OSX and not is_Ubuntu())

ICON_OVERLAY = envint("XPRA_ICON_OVERLAY", 50)
SAVE_WINDOW_ICONS = envbool("XPRA_SAVE_WINDOW_ICONS", False)
Expand Down Expand Up @@ -3494,9 +3494,9 @@ def set_tray_icon(self):
if icon:
has_alpha = icon.mode=="RGBA"
width, height = icon.size
traylog("set_tray_icon() using unique icon: %ix%i", width, height)
traylog("set_tray_icon() using unique %s icon: %ix%i (has-alpha=%s)", icon.mode, width, height, has_alpha)
rowstride = width * (3+int(has_alpha))
rgb_data = icon.tobytes("raw")
rgb_data = icon.tobytes("raw", icon.mode)
self.tray.set_icon_from_data(rgb_data, has_alpha, width, height, rowstride)
return
#this sets the default icon (badly named function!)
Expand Down
2 changes: 1 addition & 1 deletion src/xpra/platform/win32/win32_NotifyIcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ def set_icon_from_data(self, pixels, has_alpha, w, h, rowstride, options={}):
icon_h = GetSystemMetrics(win32con.SM_CYSMICON)
if w!=icon_w or h!=icon_h:
log("resizing tray icon to %ix%i", icon_w, icon_h)
img = img.resize((w, h), Image.ANTIALIAS)
w, h = icon_w, icon_h
img = img.resize((w, h), Image.ANTIALIAS)
rowstride = w*4

bitmap = 0
Expand Down

0 comments on commit 806e6b9

Please sign in to comment.