summaryrefslogtreecommitdiff
path: root/mcwm.c
diff options
context:
space:
mode:
authorMichael Cardell Widerkrantz <mc@hack.org>2012-03-06 14:05:32 +0100
committerMichael Cardell Widerkrantz <mc@hack.org>2012-03-06 14:05:32 +0100
commit350e8df632cf0780766707914f9703465a7c9f5f (patch)
treeab2dcc875ded3dafbc6520bd7550c46433286e6c /mcwm.c
parent76ab4565f205b973a7f9f0a9d526e24202d42604 (diff)
downloadmcwm-350e8df632cf0780766707914f9703465a7c9f5f.zip
Declare variable iter at top of block.
Added comments.
Diffstat (limited to 'mcwm.c')
-rw-r--r--mcwm.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/mcwm.c b/mcwm.c
index 814083f..1bfced2 100644
--- a/mcwm.c
+++ b/mcwm.c
@@ -4106,6 +4106,7 @@ int main(int argc, char **argv)
char *unfocuscol;
char *fixedcol;
int scrno;
+ xcb_screen_iterator_t iter;
/* Install signal handlers. */
@@ -4179,7 +4180,11 @@ int main(int argc, char **argv)
exit(0);
} /* switch */
}
-
+
+ /*
+ * Use $DISPLAY. After connecting scrno will contain the value of
+ * the display's screen.
+ */
conn = xcb_connect(NULL, &scrno);
if (xcb_connection_has_error(conn))
{
@@ -4187,9 +4192,8 @@ int main(int argc, char **argv)
exit(1);
}
- xcb_screen_iterator_t iter
- = xcb_setup_roots_iterator(xcb_get_setup(conn));
-
+ /* Find our screen. */
+ iter = xcb_setup_roots_iterator(xcb_get_setup(conn));
for (int i = 0; i < scrno; ++ i)
{
xcb_screen_next(&iter);