aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
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;