From 8fb3110ebb1f4ac46729ceac906e21674368d93d Mon Sep 17 00:00:00 2001 From: Bert Date: Tue, 1 Feb 2011 16:21:58 +0100 Subject: Bug fix: handle negative offsets in -g arg correctly --- Makefile | 2 +- window.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a7097c4..26b9fc9 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ all: sxiv -VERSION=git-20110131 +VERSION=git-20110201 CC?=gcc PREFIX?=/usr/local diff --git a/window.c b/window.c index 2b3e266..3904fe8 100644 --- a/window.c +++ b/window.c @@ -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, -- cgit v1.2.3-54-g00ecf