summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cardell Widerkrantz <mc@hack.org>2011-03-01 07:09:28 +0100
committerMichael Cardell Widerkrantz <mc@hack.org>2011-03-08 12:14:38 +0100
commit395d16e4381d0c96d30d3daff806ac7113de9a5f (patch)
treeda0cd184604dacd31a8a8cc8566f1f43225c7119
parent0acf6c27267b63f9e11f0374346e53c423addd14 (diff)
downloadmcwm-395d16e4381d0c96d30d3daff806ac7113de9a5f.zip
Explicitly check for NULL client before trying to configure a window.
-rw-r--r--mcwm.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/mcwm.c b/mcwm.c
index 1ba6681..56f6416 100644
--- a/mcwm.c
+++ b/mcwm.c
@@ -1258,20 +1258,17 @@ void focusnext(void)
PDEBUG("Began tabbing.\n");
}
-
+
/* If we currently have no focus focus first in list. */
if (NULL == focuswin)
{
- if (NULL == wslist[curws])
- {
- PDEBUG("No windows to focus on.\n");
- return;
- }
PDEBUG("Focusing first in list: %p\n", wslist[curws]);
client = wslist[curws]->data;
}
else
{
+ assert(NULL != focuswin->wsitem[curws]);
+
if (NULL == focuswin->wsitem[curws]->next)
{
/*
@@ -1294,16 +1291,19 @@ void focusnext(void)
}
} /* if NULL focuswin */
- /*
- * Raise window if it's occluded, then warp pointer into it and
- * set keyboard focus to it.
- */
- uint32_t values[] = { XCB_STACK_MODE_TOP_IF };
+ if (NULL != client)
+ {
+ /*
+ * Raise window if it's occluded, then warp pointer into it and
+ * set keyboard focus to it.
+ */
+ uint32_t values[] = { XCB_STACK_MODE_TOP_IF };
- xcb_configure_window(conn, client->id, XCB_CONFIG_WINDOW_STACK_MODE,
- values);
- xcb_warp_pointer(conn, XCB_NONE, client->id, 0, 0, 0, 0, 0, 0);
- setfocus(client);
+ xcb_configure_window(conn, client->id, XCB_CONFIG_WINDOW_STACK_MODE,
+ values);
+ xcb_warp_pointer(conn, XCB_NONE, client->id, 0, 0, 0, 0, 0, 0);
+ setfocus(client);
+ }
}
/* Mark window win as unfocused. */