nsxiv8fb3110
Bug fix: handle negative offsets in -g arg correctly
+5 −1
2 files changed
| @@ -1,6 +1,6 @@ | |||
| 1 | 1 | all: sxiv | |
| 2 | 2 | ||
| 3 | − | VERSION=git-20110131 | |
| 3 | + | VERSION=git-20110201 | |
| 4 | 4 | ||
| 5 | 5 | CC?=gcc | |
| 6 | 6 | PREFIX?=/usr/local | |
| @@ -76,8 +76,12 @@ void win_open(win_t *win) { | |||
| 76 | 76 | win->h = e->scrh; | |
| 77 | 77 | if (!(gmask & XValue)) | |
| 78 | 78 | win->x = (e->scrw - win->w) / 2; | |
| 79 | + | else if (gmask & XNegative) | |
| 80 | + | win->x += e->scrw - win->w; | |
| 79 | 81 | if (!(gmask & YValue)) | |
| 80 | 82 | win->y = (e->scrh - win->h) / 2; | |
| 83 | + | else if (gmask & YNegative) | |
| 84 | + | win->y += e->scrh - win->h; | |
| 81 | 85 | ||
| 82 | 86 | win->xwin = XCreateWindow(e->dpy, RootWindow(e->dpy, e->scr), | |
| 83 | 87 | win->x, win->y, win->w, win->h, 0, | |