Skip to content

Commit

Permalink
Fix tray icon coloring code - do not crop/dislocate icon fragments
Browse files Browse the repository at this point in the history
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
  • Loading branch information
marmarek committed Mar 7, 2020
1 parent 697f679 commit b5369a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gui-daemon/trayicon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit b5369a1

Please sign in to comment.