lel

Fork of Hiltjo's Farbfeld image viewer. (It was just for fun, not much use)
Log | Files | Refs | README | LICENSE

commit ec398bcac7faba802d51f80715c6bc2c545727d4
parent caa4415bf3614acc5f06c91b01ecc3ed32705dac
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Sun, 18 Apr 2021 14:56:32 -0700

Remove window size variables

The reqwin* variables were entirely redundent as they were always
set to the image sizes. The winx and winy variables are always 0
after the removal of the x and y options.

Diffstat:
Mlel.c | 8++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/lel.c b/lel.c @@ -47,7 +47,6 @@ static XImage *ximg; static char *bgcolor = "#000000"; static float zoominc = 0.25; static int paninc = 20; -static int winx, winy, reqwinwidth = 320, reqwinheight = 240; static char **imgs; static int done; @@ -140,16 +139,13 @@ loadimg(void) fp = fopen(imgs[img.index], "rb"); if (fp == NULL || ff_open(&img, fp) || ff_read(&img, fp) || fclose(fp)) die(imgs[img.index]); - - reqwinwidth = img.width; - reqwinheight = img.height; } static void reloadimg(void) { loadimg(); - XResizeWindow(dpy, win, reqwinwidth, reqwinheight); + XResizeWindow(dpy, win, img.width, img.height); XStoreName(dpy, win, imgs[img.index]); XFlush(dpy); } @@ -467,7 +463,7 @@ setup(void) xfd = ConnectionNumber(dpy); screen = DefaultScreen(dpy); - win = XCreateWindow(dpy, DefaultRootWindow(dpy), winx, winy, reqwinwidth, reqwinheight, 0, + win = XCreateWindow(dpy, DefaultRootWindow(dpy), 0, 0, img.width, img.height, 0, DefaultDepth(dpy, screen), InputOutput, CopyFromParent, 0, NULL); gc = XCreateGC(dpy, win, 0, NULL);