summaryrefslogtreecommitdiff
path: root/mcwm.c
diff options
context:
space:
mode:
authorMichael Cardell Widerkrantz <mc@hack.org>2010-07-20 15:53:59 +0200
committerMichael Cardell Widerkrantz <mc@hack.org>2010-07-20 15:53:59 +0200
commit02f7e3244f66540302e3252c27906aac89e63220 (patch)
treeeb09a444a8d34b940c282b1efe51dff142bc301d /mcwm.c
parentb407412fd03ccfec4e7388584b47e91817c0385b (diff)
downloadmcwm-02f7e3244f66540302e3252c27906aac89e63220.zip
Moved xcb_disconnect() to die().
Added comments about pathological case of findclient() returning NULL to setfocus().
Diffstat (limited to 'mcwm.c')
-rw-r--r--mcwm.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/mcwm.c b/mcwm.c
index 9fab87c..f0c743a 100644
--- a/mcwm.c
+++ b/mcwm.c
@@ -267,6 +267,8 @@ void die(int code)
{
abort();
}
+
+ xcb_disconnect(conn);
exit(code);
}
@@ -1134,7 +1136,13 @@ void setfocus(struct client *client)
{
uint32_t values[1];
- /* if client is NULL, we focus on whatever the pointer is on. */
+ /*
+ * If client is NULL, we focus on whatever the pointer is on.
+ *
+ * This is a pathological case, but it will make the poor user
+ * able to focus on windows anyway, even though this window
+ * manager might be buggy.
+ */
if (NULL == client)
{
focuswin = NULL;
@@ -2435,7 +2443,9 @@ void events(void)
if (NULL == focuswin || e->event != focuswin->id)
{
/*
- * Otherwise, set focus to the window we just entered.
+ * Otherwise, set focus to the window we just
+ * entered. Note that setfocus() will handle the
+ * case if we didn't find the client.
*/
client = findclient(e->event);
setfocus(client);
@@ -2792,8 +2802,4 @@ int main(int argc, char **argv)
/* Die gracefully. */
die(exitcode);
-
- xcb_disconnect(conn);
-
- exit(0);
}