commit 546dd288c02cdab44e92fbfbbe86de57c680e1e1
parent a414f4a7079fc96d266d18b5622585d1dedf0c16
Author: veltza <106755522+veltza@users.noreply.github.com>
Date: Fri, 14 Jun 2024 19:16:32 +0300
sixel: scale images on both screens when zooming in/out (#141)
This fixes an issue where images on the main screen don't scale when you
increase or decrease the font size on the alt screen.
Diffstat:
| M | x.c | | | 19 | +++++++++++-------- |
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/x.c b/x.c
@@ -318,6 +318,7 @@ void
zoomabs(const Arg *arg)
{
#if SIXEL_PATCH
+ int i;
ImageList *im;
#endif // SIXEL_PATCH
@@ -328,14 +329,16 @@ zoomabs(const Arg *arg)
#endif // FONT2_PATCH
#if SIXEL_PATCH
- /* deleting old pixmaps forces the new scaled pixmaps to be created */
- for (im = term.images; im; im = im->next) {
- if (im->pixmap)
- XFreePixmap(xw.dpy, (Drawable)im->pixmap);
- if (im->clipmask)
- XFreePixmap(xw.dpy, (Drawable)im->clipmask);
- im->pixmap = NULL;
- im->clipmask = NULL;
+ /* delete old pixmaps so that xfinishdraw() can create new scaled ones */
+ for (im = term.images, i = 0; i < 2; i++, im = term.images_alt) {
+ for (; im; im = im->next) {
+ if (im->pixmap)
+ XFreePixmap(xw.dpy, (Drawable)im->pixmap);
+ if (im->clipmask)
+ XFreePixmap(xw.dpy, (Drawable)im->clipmask);
+ im->pixmap = NULL;
+ im->clipmask = NULL;
+ }
}
#endif // SIXEL_PATCH