Commit df38533b authored by Tinu Weber's avatar Tinu Weber

client_create: Clean up initialisation a bit

It was quite a hot mess, to be honest.
parent 0e7c6034
......@@ -107,6 +107,8 @@ client_create(Window win, bool viewable)
sizeof(struct client), strerror(errno));
}
c->win = win;
/* dimensions */
c->dim = (struct rectangle) {
.x = 0,
.y = 0,
......@@ -119,25 +121,30 @@ client_create(Window win, bool viewable)
.width = (int unsigned) wa.width,
.height = (int unsigned) wa.height,
};
debug("new window's size attributes: %ux%u%+d%+d",
c->dim_floating.width, c->dim_floating.height,
c->dim_floating.x, c->dim_floating.y);
c->floating = false;
c->fullscreen = false;
c->dirty = false;
c->border.width = config_get()->window.border.width;
XSetWindowBorderWidth(x11.dpy, c->win, c->border.width);
client_query_size_hints(c);
/* name */
c->name[0] = '\0';
c->dialog = false;
client_query_name(c);
/* type */
c->floating = false;
c->dialog = false;
client_query_window_type(c);
/* state */
c->fullscreen = false;
client_query_window_state(c);
/* input and appearance */
c->focused = false;
c->border.width = config_get()->window.border.width;
XSetWindowBorderWidth(x11.dpy, c->win, c->border.width);
grab_input(c);
set_border(c);
/* TODO: ??? */
c->dirty = false;
return c;
}
......@@ -312,6 +319,7 @@ client_query_window_type(struct client *c)
int unsigned format;
int long unsigned nitems, remaining;
/* query if dialog */
length = sizeof(atom);
offset = 0lu;
delete = False;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment