Hello community, here is the log from the commit of package sxiv for openSUSE:Factory checked in at 2020-01-27 00:24:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sxiv (Old) and /work/SRC/openSUSE:Factory/.sxiv.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sxiv" Mon Jan 27 00:24:25 2020 rev:5 rq:767510 version:26 Changes: -------- --- /work/SRC/openSUSE:Factory/sxiv/sxiv.changes 2019-10-21 12:27:44.623916012 +0200 +++ /work/SRC/openSUSE:Factory/.sxiv.new.26092/sxiv.changes 2020-01-27 00:24:46.565563104 +0100 @@ -1,0 +2,6 @@ +Thu Jan 23 14:41:42 UTC 2020 - Sébastien POHER <[email protected]> + +- Upgrade to version 26 (maintenance release) +- Update sxiv.makefile.patch + +------------------------------------------------------------------- Old: ---- sxiv-25.tar.gz New: ---- sxiv-26.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sxiv.spec ++++++ --- /var/tmp/diff_new_pack.JerchG/_old 2020-01-27 00:24:48.361563950 +0100 +++ /var/tmp/diff_new_pack.JerchG/_new 2020-01-27 00:24:48.361563950 +0100 @@ -1,7 +1,7 @@ # # spec file for package sxiv # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: sxiv -Version: 25 +Version: 26 Release: 0 Summary: Simple X Image Viewer License: GPL-2.0-only ++++++ sxiv-25.tar.gz -> sxiv-26.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sxiv-25/.gitignore new/sxiv-26/.gitignore --- old/sxiv-25/.gitignore 2019-01-26 14:54:40.000000000 +0100 +++ new/sxiv-26/.gitignore 2020-01-16 14:30:49.000000000 +0100 @@ -1,4 +1,5 @@ config.h +version.h *.d *.o sxiv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sxiv-25/Makefile new/sxiv-26/Makefile --- old/sxiv-25/Makefile 2019-01-26 14:54:40.000000000 +0100 +++ new/sxiv-26/Makefile 2020-01-16 14:30:49.000000000 +0100 @@ -1,4 +1,4 @@ -version = 25 +version = 26 srcdir = . VPATH = $(srcdir) @@ -16,8 +16,9 @@ HAVE_LIBEXIF = 1 cflags = -std=c99 -Wall -pedantic $(CFLAGS) -cppflags = -I. $(CPPFLAGS) -D_XOPEN_SOURCE=700 -DHAVE_GIFLIB=$(HAVE_GIFLIB) \ - -DHAVE_LIBEXIF=$(HAVE_LIBEXIF) -I/usr/include/freetype2 +cppflags = -I. $(CPPFLAGS) -D_XOPEN_SOURCE=700 \ + -DHAVE_GIFLIB=$(HAVE_GIFLIB) -DHAVE_LIBEXIF=$(HAVE_LIBEXIF) \ + -I/usr/include/freetype2 -I$(PREFIX)/include/freetype2 lib_exif_0 = lib_exif_1 = -lexif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sxiv-25/README.md new/sxiv-26/README.md --- old/sxiv-25/README.md 2019-01-26 14:54:40.000000000 +0100 +++ new/sxiv-26/README.md 2020-01-16 14:30:49.000000000 +0100 @@ -32,9 +32,27 @@  -Installation +Dependencies ------------ +sxiv requires the following software to be installed: + + * Imlib2 + * X11 + * Xft + * freetype2 + * fontconfig + * giflib (optional, disabled with `HAVE_GIFLIB=0`) + * libexif (optional, disabled with `HAVE_LIBEXIF=0`) + +Please make sure to install the corresponding development packages in case that +you want to build sxiv on a distribution with separate runtime and development +packages (e.g. *-dev on Debian). + + +Building +-------- + sxiv is built using the commands: $ make @@ -74,6 +92,11 @@ **Stable releases** +**[v26](https://github.com/muennich/sxiv/archive/v26.tar.gz)** +*(January 16, 2020)* + + * Maintenance release + **[v25](https://github.com/muennich/sxiv/archive/v25.tar.gz)** *(January 26, 2019)* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sxiv-25/config.def.h new/sxiv-26/config.def.h --- old/sxiv-25/config.def.h 2019-01-26 14:54:40.000000000 +0100 +++ new/sxiv-26/config.def.h 2020-01-16 14:30:49.000000000 +0100 @@ -6,17 +6,10 @@ WIN_HEIGHT = 600 }; -/* bar font: - * (see fonts-conf(5) subsection "FONT NAMES" for valid values) +/* colors and font are configured with 'background', 'foreground' and + * 'font' X resource properties. + * See X(7) section Resources and xrdb(1) for more information. */ -static const char * const BAR_FONT = "monospace:size=8"; - -/* colors: - * overwritten by 'background' and 'foreground' X resource properties. - * (see X(7) section "COLOR NAMES" for valid values) - */ -static const char * const BG_COLOR = "#ffffea"; -static const char * const FG_COLOR = "#555555"; #endif #ifdef _IMAGE_CONFIG diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sxiv-25/image.c new/sxiv-26/image.c --- old/sxiv-25/image.c 2019-01-26 14:54:40.000000000 +0100 +++ new/sxiv-26/image.c 2020-01-16 14:30:49.000000000 +0100 @@ -497,7 +497,7 @@ } imlib_image_put_back_data(data); } else { - c = win->fullscreen ? win->black.pixel : win->bg.pixel; + c = win->bg.pixel; imlib_context_set_color(c >> 16 & 0xFF, c >> 8 & 0xFF, c & 0xFF, 0xFF); imlib_image_fill_rectangle(0, 0, dw, dh); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sxiv-25/main.c new/sxiv-26/main.c --- old/sxiv-25/main.c 2019-01-26 14:54:40.000000000 +0100 +++ new/sxiv-26/main.c 2020-01-16 14:30:49.000000000 +0100 @@ -70,10 +70,10 @@ } extcmd_t; struct { - extcmd_t f; - int fd; - unsigned int i, lastsep; - pid_t pid; + extcmd_t f; + int fd; + unsigned int i, lastsep; + pid_t pid; } info; struct { @@ -774,7 +774,7 @@ } else { tns.dirty = true; } - if (!resized || win.fullscreen) { + if (!resized) { redraw(); set_timeout(clear_resize, TO_REDRAW_RESIZE, false); resized = true; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sxiv-25/sxiv.1 new/sxiv-26/sxiv.1 --- old/sxiv-25/sxiv.1 2019-01-26 14:54:40.000000000 +0100 +++ new/sxiv-26/sxiv.1 2020-01-16 14:30:49.000000000 +0100 @@ -375,6 +375,19 @@ .TP .B ScrollDown Zoom out. +.SH CONFIGURATION +The following X resources are supported: +.TP +.B background +Color of the window background and bar foreground +.TP +.B foreground +Color of the window foreground and bar background +.TP +.B font +Name of Xft bar font +.TP +Please see xrdb(1) on how to change them. .SH STATUS BAR The information displayed on the left side of the status bar can be replaced with the output of a user-provided script, which is called by sxiv whenever an @@ -431,5 +444,5 @@ https://github.com/muennich/sxiv .EE .SH SEE ALSO -.BR feh (1), -.BR qiv (1) +.BR X (7), +.BR xrdb (1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sxiv-25/sxiv.h new/sxiv-26/sxiv.h --- old/sxiv-25/sxiv.h 2019-01-26 14:54:40.000000000 +0100 +++ new/sxiv-26/sxiv.h 2020-01-16 14:30:49.000000000 +0100 @@ -385,7 +385,6 @@ ATOM__NET_WM_ICON, ATOM__NET_WM_STATE, ATOM__NET_WM_STATE_FULLSCREEN, - ATOM__NET_SUPPORTED, ATOM_COUNT }; @@ -408,10 +407,8 @@ Window xwin; win_env_t env; - bool light; /* bg is lighter than fg */ XftColor bg; XftColor fg; - XftColor black; int x; int y; @@ -419,8 +416,6 @@ unsigned int h; /* = win height - bar height */ unsigned int bw; - bool fullscreen; - struct { int w; int h; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sxiv-25/thumbs.c new/sxiv-26/thumbs.c --- old/sxiv-25/thumbs.c 2019-01-26 14:54:40.000000000 +0100 +++ new/sxiv-26/thumbs.c 2020-01-16 14:30:49.000000000 +0100 @@ -79,7 +79,7 @@ char *cfile, *dirend; struct stat cstats, fstats; struct utimbuf times; - Imlib_Load_Error err = 0; + Imlib_Load_Error err; if (options->private_mode) return; @@ -93,26 +93,27 @@ { if ((dirend = strrchr(cfile, '/')) != NULL) { *dirend = '\0'; - if ((err = r_mkdir(cfile)) == -1) + if (r_mkdir(cfile) == -1) { error(0, errno, "%s", cfile); - *dirend = '/'; - } - if (err == 0) { - imlib_context_set_image(im); - if (imlib_image_has_alpha()) { - imlib_image_set_format("png"); - } else { - imlib_image_set_format("jpg"); - imlib_image_attach_data_value("quality", NULL, 90, NULL); + goto end; } - imlib_save_image_with_error_return(cfile, &err); + *dirend = '/'; } - if (err == 0) { - times.actime = fstats.st_atime; - times.modtime = fstats.st_mtime; - utime(cfile, ×); + imlib_context_set_image(im); + if (imlib_image_has_alpha()) { + imlib_image_set_format("png"); + } else { + imlib_image_set_format("jpg"); + imlib_image_attach_data_value("quality", NULL, 90, NULL); } + imlib_save_image_with_error_return(cfile, &err); + if (err) + goto end; + times.actime = fstats.st_atime; + times.modtime = fstats.st_mtime; + utime(cfile, ×); } +end: free(cfile); } } @@ -468,14 +469,14 @@ if (n >= 0 && n < *tns->cnt && tns->thumbs[n].im != NULL) { win_t *win = tns->win; thumb_t *t = &tns->thumbs[n]; - unsigned long col = win->fullscreen ? win->black.pixel : win->bg.pixel; + unsigned long col = win->bg.pixel; int x = t->x + t->w, y = t->y + t->h; win_draw_rect(win, x - 1, y + 1, 1, tns->bw, true, 1, col); win_draw_rect(win, x + 1, y - 1, tns->bw, 1, true, 1, col); if (mark) - col = win->fullscreen && win->light ? win->bg.pixel : win->fg.pixel; + col = win->fg.pixel; win_draw_rect(win, x, y, tns->bw + 2, tns->bw + 2, true, 1, col); @@ -489,14 +490,9 @@ if (n >= 0 && n < *tns->cnt && tns->thumbs[n].im != NULL) { win_t *win = tns->win; thumb_t *t = &tns->thumbs[n]; - unsigned long col; + unsigned long col = hl ? win->fg.pixel : win->bg.pixel; int oxy = (tns->bw + 1) / 2 + 1, owh = tns->bw + 2; - if (hl) - col = win->fullscreen && win->light ? win->bg.pixel : win->fg.pixel; - else - col = win->fullscreen ? win->black.pixel : win->bg.pixel; - win_draw_rect(win, t->x - oxy, t->y - oxy, t->w + owh, t->h + owh, false, tns->bw, col); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sxiv-25/window.c new/sxiv-26/window.c --- old/sxiv-25/window.c 2019-01-26 14:54:40.000000000 +0100 +++ new/sxiv-26/window.c 2020-01-16 14:30:49.000000000 +0100 @@ -48,18 +48,17 @@ static XftFont *font; static int fontheight; +static double fontsize; static int barheight; Atom atoms[ATOM_COUNT]; -static Bool fs_support; -static Bool fs_warned; - void win_init_font(const win_env_t *e, const char *fontstr) { if ((font = XftFontOpenName(e->dpy, e->scr, fontstr)) == NULL) error(EXIT_FAILURE, 0, "Error loading font '%s'", fontstr); fontheight = font->ascent + font->descent; + FcPatternGetDouble(font->pattern, FC_SIZE, 0, &fontsize); barheight = fontheight + 2 * V_TEXT_PAD; } @@ -72,48 +71,14 @@ } } -void win_check_wm_support(Display *dpy, Window root) -{ - int format; - long offset = 0, length = 16; - Atom *data, type; - unsigned long i, nitems, bytes_left; - Bool found = False; - - while (!found && length > 0) { - if (XGetWindowProperty(dpy, root, atoms[ATOM__NET_SUPPORTED], - offset, length, False, XA_ATOM, &type, &format, - &nitems, &bytes_left, (unsigned char**) &data)) - { - break; - } - if (type == XA_ATOM && format == 32) { - for (i = 0; i < nitems; i++) { - if (data[i] == atoms[ATOM__NET_WM_STATE_FULLSCREEN]) { - found = True; - fs_support = True; - break; - } - } - } - XFree(data); - offset += nitems; - length = MIN(length, bytes_left / 4); - } -} - -const char* win_res(Display *dpy, const char *name, const char *def) +const char* win_res(XrmDatabase db, const char *name, const char *def) { char *type; XrmValue ret; - XrmDatabase db; - char *res_man; - - XrmInitialize(); - if ((res_man = XResourceManagerString(dpy)) != NULL && - (db = XrmGetStringDatabase(res_man)) != NULL && - XrmGetResource(db, name, name, &type, &ret) && STREQ(type, "String")) + if (db != None && + XrmGetResource(db, name, name, &type, &ret) && + STREQ(type, "String")) { return ret.addr; } else { @@ -121,18 +86,15 @@ } } -unsigned int win_luminance(const XftColor *col) -{ - return (col->color.red + col->color.green + col->color.blue) / 3; -} - #define INIT_ATOM_(atom) \ atoms[ATOM_##atom] = XInternAtom(e->dpy, #atom, False); void win_init(win_t *win) { win_env_t *e; - const char *bg, *fg; + const char *bg, *fg, *f; + char *res_man; + XrmDatabase db; memset(win, 0, sizeof(win_t)); @@ -150,14 +112,17 @@ if (setlocale(LC_CTYPE, "") == NULL || XSupportsLocale() == 0) error(0, 0, "No locale support"); - win_init_font(e, BAR_FONT); + XrmInitialize(); + res_man = XResourceManagerString(e->dpy); + db = res_man != NULL ? XrmGetStringDatabase(res_man) : None; + + f = win_res(db, RES_CLASS ".font", "monospace-8"); + win_init_font(e, f); - bg = win_res(e->dpy, RES_CLASS ".background", BG_COLOR); - fg = win_res(e->dpy, RES_CLASS ".foreground", FG_COLOR); + bg = win_res(db, RES_CLASS ".background", "white"); + fg = win_res(db, RES_CLASS ".foreground", "black"); win_alloc_color(e, bg, &win->bg); win_alloc_color(e, fg, &win->fg); - win_alloc_color(e, "black", &win->black); - win->light = win_luminance(&win->bg) > win_luminance(&win->fg); win->bar.l.size = BAR_L_LEN; win->bar.r.size = BAR_R_LEN; @@ -174,9 +139,6 @@ INIT_ATOM_(_NET_WM_ICON); INIT_ATOM_(_NET_WM_STATE); INIT_ATOM_(_NET_WM_STATE_FULLSCREEN); - INIT_ATOM_(_NET_SUPPORTED); - - win_check_wm_support(e->dpy, RootWindow(e->dpy, e->scr)); } void win_open(win_t *win) @@ -192,7 +154,6 @@ Pixmap none; int gmask; XSizeHints sizehints; - Bool fullscreen = options->fullscreen && fs_support; e = &win->env; parent = options->embed != 0 ? options->embed : RootWindow(e->dpy, e->scr); @@ -297,14 +258,14 @@ win->buf.h = e->scrh; win->buf.pm = XCreatePixmap(e->dpy, win->xwin, win->buf.w, win->buf.h, e->depth); - XSetForeground(e->dpy, gc, fullscreen ? win->black.pixel : win->bg.pixel); + XSetForeground(e->dpy, gc, win->bg.pixel); XFillRectangle(e->dpy, win->buf.pm, gc, 0, 0, win->buf.w, win->buf.h); XSetWindowBackgroundPixmap(e->dpy, win->xwin, win->buf.pm); XMapWindow(e->dpy, win->xwin); XFlush(e->dpy); - if (fullscreen) + if (options->fullscreen) win_toggle_fullscreen(win); } @@ -341,15 +302,6 @@ XEvent ev; XClientMessageEvent *cm; - if (!fs_support) { - if (!fs_warned) { - error(0, 0, "No fullscreen support"); - fs_warned = True; - } - return; - } - win->fullscreen = !win->fullscreen; - memset(&ev, 0, sizeof(ev)); ev.type = ClientMessage; @@ -357,9 +309,8 @@ cm->window = win->xwin; cm->message_type = atoms[ATOM__NET_WM_STATE]; cm->format = 32; - cm->data.l[0] = win->fullscreen; + cm->data.l[0] = 2; // toggle cm->data.l[1] = atoms[ATOM__NET_WM_STATE_FULLSCREEN]; - cm->data.l[2] = cm->data.l[3] = 0; XSendEvent(win->env.dpy, DefaultRootWindow(win->env.dpy), False, SubstructureNotifyMask | SubstructureRedirectMask, &ev); @@ -389,7 +340,7 @@ win->buf.pm = XCreatePixmap(e->dpy, win->xwin, win->buf.w, win->buf.h, e->depth); } - XSetForeground(e->dpy, gc, win->fullscreen ? win->black.pixel : win->bg.pixel); + XSetForeground(e->dpy, gc, win->bg.pixel); XFillRectangle(e->dpy, win->buf.pm, gc, 0, 0, win->buf.w, win->buf.h); } @@ -414,7 +365,8 @@ fccharset = FcCharSetCreate(); FcCharSetAddChar(fccharset, rune); f = XftFontOpen(win->env.dpy, win->env.scr, FC_CHARSET, FcTypeCharSet, - fccharset, FC_SCALABLE, FcTypeBool, FcTrue, NULL); + fccharset, FC_SCALABLE, FcTypeBool, FcTrue, + FC_SIZE, FcTypeDouble, fontsize, NULL); FcCharSetDestroy(fccharset); } XftTextExtentsUtf8(win->env.dpy, f, (XftChar8*)t, next - t, &ext); @@ -435,7 +387,6 @@ win_env_t *e; win_bar_t *l, *r; XftDraw *d; - const XftColor *bg, *fg; if ((l = &win->bar.l)->buf == NULL || (r = &win->bar.r)->buf == NULL) return; @@ -446,28 +397,23 @@ d = XftDrawCreate(e->dpy, win->buf.pm, DefaultVisual(e->dpy, e->scr), DefaultColormap(e->dpy, e->scr)); - if (win->fullscreen && !win->light) - bg = &win->bg, fg = &win->fg; - else - bg = &win->fg, fg = &win->bg; - - XSetForeground(e->dpy, gc, bg->pixel); + XSetForeground(e->dpy, gc, win->fg.pixel); XFillRectangle(e->dpy, win->buf.pm, gc, 0, win->h, win->w, win->bar.h); - XSetForeground(e->dpy, gc, fg->pixel); - XSetBackground(e->dpy, gc, bg->pixel); + XSetForeground(e->dpy, gc, win->bg.pixel); + XSetBackground(e->dpy, gc, win->fg.pixel); if ((len = strlen(r->buf)) > 0) { if ((tw = TEXTWIDTH(win, r->buf, len)) > w) return; x = win->w - tw - H_TEXT_PAD; w -= tw; - win_draw_text(win, d, fg, x, y, r->buf, len, tw); + win_draw_text(win, d, &win->bg, x, y, r->buf, len, tw); } if ((len = strlen(l->buf)) > 0) { x = H_TEXT_PAD; w -= 2 * H_TEXT_PAD; /* gap between left and right parts */ - win_draw_text(win, d, fg, x, y, l->buf, len, w); + win_draw_text(win, d, &win->bg, x, y, l->buf, len, w); } XftDrawDestroy(d); } ++++++ sxiv.makefile.patch ++++++ --- /var/tmp/diff_new_pack.JerchG/_old 2020-01-27 00:24:48.409563973 +0100 +++ /var/tmp/diff_new_pack.JerchG/_new 2020-01-27 00:24:48.409563973 +0100 @@ -1,20 +1,21 @@ -Index: sxiv-25/Makefile +Index: sxiv-26/Makefile =================================================================== ---- sxiv-25.orig/Makefile 2019-01-26 14:54:40.000000000 +0100 -+++ sxiv-25/Makefile 2019-10-13 16:45:00.384870829 +0200 -@@ -16,8 +16,9 @@ +--- sxiv-26.orig/Makefile 2020-01-23 15:37:18.890637361 +0100 ++++ sxiv-26/Makefile 2020-01-23 15:39:24.990140641 +0100 +@@ -16,9 +16,9 @@ HAVE_LIBEXIF = 1 cflags = -std=c99 -Wall -pedantic $(CFLAGS) --cppflags = -I. $(CPPFLAGS) -D_XOPEN_SOURCE=700 -DHAVE_GIFLIB=$(HAVE_GIFLIB) \ -- -DHAVE_LIBEXIF=$(HAVE_LIBEXIF) -I/usr/include/freetype2 +-cppflags = -I. $(CPPFLAGS) -D_XOPEN_SOURCE=700 \ +- -DHAVE_GIFLIB=$(HAVE_GIFLIB) -DHAVE_LIBEXIF=$(HAVE_LIBEXIF) \ +- -I/usr/include/freetype2 -I$(PREFIX)/include/freetype2 +cppflags = -I. $(CPPFLAGS) -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" \ + -DHAVE_GIFLIB=$(HAVE_GIFLIB) -DHAVE_LIBEXIF=$(HAVE_LIBEXIF) \ + -I/usr/include/freetype2 lib_exif_0 = lib_exif_1 = -lexif -@@ -76,6 +77,7 @@ +@@ -77,6 +77,7 @@ mkdir -p $(DESTDIR)$(PREFIX)/share/sxiv/exec cp exec/* $(DESTDIR)$(PREFIX)/share/sxiv/exec/ chmod 755 $(DESTDIR)$(PREFIX)/share/sxiv/exec/* @@ -22,10 +23,10 @@ uninstall: @echo "REMOVE bin/sxiv" -@@ -84,4 +86,5 @@ +@@ -85,4 +86,6 @@ rm -f $(DESTDIR)$(MANPREFIX)/man1/sxiv.1 @echo "REMOVE share/sxiv/" rm -rf $(DESTDIR)$(PREFIX)/share/sxiv -- + @echo "REMOVE share/applications/sxiv.desktop" + rm -f $(DESTDIR)$(PREFIX)/share/applications/sxiv.desktop +
