summaryrefslogtreecommitdiffstats
path: root/window.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-01-21 12:57:35 +0100
committerBert <ber.t@gmx.com>2011-01-21 12:57:35 +0100
commitc7860b690b687492f90202e77d575f5855f04433 (patch)
tree9a80ff127810907c978fe06a283b7dd7495cb4ec /window.c
parent629d37376d1c9b175a525e8c30f8d468996a3bd6 (diff)
downloadnsxiv-c7860b690b687492f90202e77d575f5855f04433.tar.zst
Stricter object encapsulation
Diffstat (limited to 'window.c')
-rw-r--r--window.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/window.c b/window.c
index aa39406..fc6a264 100644
--- a/window.c
+++ b/window.c
@@ -32,16 +32,14 @@ void win_open(win_t *win) {
if (!win)
return;
-
- e = &win->env;
+ e = &win->env;
if (!(e->dpy = XOpenDisplay(NULL)))
DIE("could not open display");
-
+
e->scr = DefaultScreen(e->dpy);
e->scrw = DisplayWidth(e->dpy, e->scr);
e->scrh = DisplayHeight(e->dpy, e->scr);
-
e->vis = DefaultVisual(e->dpy, e->scr);
e->cmap = DefaultColormap(e->dpy, e->scr);
e->depth = DefaultDepth(e->dpy, e->scr);
@@ -50,6 +48,8 @@ void win_open(win_t *win) {
&bgcol, &bgcol))
DIE("could not allocate color: %s", BG_COLOR);
+ win->w = WIN_WIDTH;
+ win->h = WIN_HEIGHT;
if (win->w > e->scrw)
win->w = e->scrw;
if (win->h > e->scrh)
@@ -66,10 +66,9 @@ void win_open(win_t *win) {
XSelectInput(e->dpy, win->xwin,
StructureNotifyMask | KeyPressMask);
- win->pm = 0;
-
gcval.foreground = bgcol.pixel;
win->bgc = XCreateGC(e->dpy, win->xwin, GCForeground, &gcval);
+ win->pm = 0;
win_set_title(win, "sxiv");