From 512ca765d74be645914f4d246716442be741558c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 8 Mar 2020 00:20:48 +0100 Subject: [PATCH] Fix tray icon coloring code - do not crop/dislocate icon fragments When only part of the icon was redrawn, the code used wrong coordinates and instead of putting that part back at the correct (x, y) coordinates, it put it at (x, x). Additionally, it used cropped part of that icon, because of again using (x, x) start coordinates (in an image already containing just updated fragment) instead of (0, 0). It worked accidentally only when the application always redraw the whole icon (or at least its top-left part - so x=y=0). Which apparently is a very common thing applications do. Fixes QubesOS/qubes-issues#5704 (cherry picked from commit b5369a1b999f142e79edc30819375b56033c837b) --- gui-daemon/trayicon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui-daemon/trayicon.c b/gui-daemon/trayicon.c index e1b0cf2a..bbcfc678 100644 --- a/gui-daemon/trayicon.c +++ b/gui-daemon/trayicon.c @@ -269,7 +269,7 @@ void tint_tray_and_update(Ghandles *g, struct windowdata *vm_window, } } XPutImage(g->display, vm_window->local_winid, - g->context, image, x, x, x, x, w, h); + g->context, image, 0, 0, x, y, w, h); XDestroyImage(image); XFreePixmap(g->display, pixmap); }