Krolyxon
Commit 8fb3110

Branches

Refs →

nsxiv8fb3110

Bug fix: handle negative offsets in -g arg correctly

Author
Bert
Date
2011-02-01 16:21 +0100
Parent
1576eb4
Commit
8fb3110ebb1f4ac46729ceac906e21674368d93d

+5 −1

2 files changed

  1. M Makefile +1 −1
  2. M window.c +4 −0
M Makefile View
@@ -1,6 +1,6 @@
11 all: sxiv
22
3−VERSION=git-20110131
3+VERSION=git-20110201
44
55 CC?=gcc
66 PREFIX?=/usr/local
M window.c View
@@ -76,8 +76,12 @@ void win_open(win_t *win) {
7676 win->h = e->scrh;
7777 if (!(gmask & XValue))
7878 win->x = (e->scrw - win->w) / 2;
79+ else if (gmask & XNegative)
80+ win->x += e->scrw - win->w;
7981 if (!(gmask & YValue))
8082 win->y = (e->scrh - win->h) / 2;
83+ else if (gmask & YNegative)
84+ win->y += e->scrh - win->h;
8185
8286 win->xwin = XCreateWindow(e->dpy, RootWindow(e->dpy, e->scr),
8387 win->x, win->y, win->w, win->h, 0,