summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cardell Widerkrantz <mc@hack.org>2013-04-22 21:51:57 +0200
committerMichael Cardell Widerkrantz <mc@hack.org>2013-04-22 21:51:57 +0200
commitb2a24f778a29c2f9a79da7d781e0abc7ec95653d (patch)
tree82cb90efd3deeba6e39dc56c4ee98765b6e480be
parentf20b857e33d1ffcb36ae3a4bcf38f500e24c2536 (diff)
downloadmcwm-b2a24f778a29c2f9a79da7d781e0abc7ec95653d.zip
Use setborders() in setupwin() instead of doing it by hand. This also
means we flush directly after setting border width. Seems to fix that we didn't get a border right away for mplayer, for instance. Clarified some comments.
-rw-r--r--mcwm.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/mcwm.c b/mcwm.c
index 5aa5197..acb26af 100644
--- a/mcwm.c
+++ b/mcwm.c
@@ -1081,20 +1081,19 @@ struct client *setupwin(xcb_window_t win)
xcb_size_hints_t hints;
uint32_t ws;
- /* Set border color. */
+ /* Set default border color. */
values[0] = conf.unfocuscol;
xcb_change_window_attributes(conn, win, XCB_CW_BORDER_PIXEL, values);
- /* Set border width. */
- values[0] = conf.borderwidth;
- mask = XCB_CONFIG_WINDOW_BORDER_WIDTH;
- xcb_configure_window(conn, win, mask, values);
-
+ /* Subscribe to events we want to know about in this window. */
mask = XCB_CW_EVENT_MASK;
values[0] = XCB_EVENT_MASK_ENTER_WINDOW;
xcb_change_window_attributes_checked(conn, win, mask, values);
- /* Add this window to the X Save Set. */
+ /*
+ * Add this window to the X Save Set, that is, the windows that
+ * will be automatically restored if we die.
+ */
xcb_change_save_set(conn, XCB_SET_MODE_INSERT, win);
xcb_flush(conn);
@@ -1147,6 +1146,8 @@ struct client *setupwin(xcb_window_t win)
PDEBUG("Adding window %d\n", client->id);
+ setborders(client, conf.borderwidth);
+
/* Get window geometry. */
if (!getgeom(client->id, &client->x, &client->y, &client->width,
&client->height))