bakkeby / st-flexipatch

An st build with preprocessor directives to decide which patches to include during build time
MIT License
347 stars 107 forks source link

sixel: scale images on both screens when zooming in/out #141

Closed veltza closed 2 months ago

veltza commented 2 months ago

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.

veltza commented 2 months ago

This is just an aesthetic bug that users will hardly ever encounter. So I wouldn't have bothered to fix this if it wasn't so easy to tackle.

bakkeby commented 2 months ago

Interesting mechanism in the outer for loop.

veltza commented 2 months ago

Now that you said it, I wonder how I came to that solution. Maybe this would have been a cleaner solution:

for (i = 0; i < 2; i++) {
    for (im = i ? term.images : term.images_alt; 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;
    }
}

Oh well...