summaryrefslogtreecommitdiffstats
path: root/window.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-01-27 16:15:43 +0100
committerBert <ber.t@gmx.com>2011-01-27 16:15:43 +0100
commit17e2a795bbcdbf9bc8eb07e2aaca0a494871b9e8 (patch)
tree7550f6d978ece256b2faa5d10bc300fa0d5eef97 /window.c
parente8a503bcbb5e29e8364095796d1417db4c138e64 (diff)
downloadnsxiv-17e2a795bbcdbf9bc8eb07e2aaca0a494871b9e8.tar.zst
Added -w cmdline option
Diffstat (limited to 'window.c')
-rw-r--r--window.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/window.c b/window.c
index e1b8ee7..89340f7 100644
--- a/window.c
+++ b/window.c
@@ -23,6 +23,7 @@
#include <X11/Xutil.h>
#include "sxiv.h"
+#include "options.h"
#include "window.h"
GC bgc;
@@ -53,12 +54,8 @@ void win_open(win_t *win) {
win->bgcol = bgcol.pixel;
win->pm = 0;
- win->w = WIN_WIDTH;
- win->h = WIN_HEIGHT;
- if (win->w > e->scrw)
- win->w = e->scrw;
- if (win->h > e->scrh)
- win->h = e->scrh;
+ win->w = MIN(options->winw, e->scrw);
+ win->h = MIN(options->winh, e->scrh);
win->x = (e->scrw - win->w) / 2;
win->y = (e->scrh - win->h) / 2;