Bug fix: handle negative offsets in -g arg correctly

This commit is contained in:
Bert 2011-02-01 16:21:58 +01:00
parent 1576eb4e17
commit 8fb3110ebb
2 changed files with 5 additions and 1 deletions

View file

@ -1,6 +1,6 @@
all: sxiv
VERSION=git-20110131
VERSION=git-20110201
CC?=gcc
PREFIX?=/usr/local

View file

@ -76,8 +76,12 @@ void win_open(win_t *win) {
win->h = e->scrh;
if (!(gmask & XValue))
win->x = (e->scrw - win->w) / 2;
else if (gmask & XNegative)
win->x += e->scrw - win->w;
if (!(gmask & YValue))
win->y = (e->scrh - win->h) / 2;
else if (gmask & YNegative)
win->y += e->scrh - win->h;
win->xwin = XCreateWindow(e->dpy, RootWindow(e->dpy, e->scr),
win->x, win->y, win->w, win->h, 0,