summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Cardell Widerkrantz <mc@hack.org>2011-03-04 14:22:00 +0100
committerMichael Cardell Widerkrantz <mc@hack.org>2011-03-08 12:14:38 +0100
commit4628d948a1806e89cdacfae7e59e229e3b758187 (patch)
tree2fc4f367039266a39e27916d7766af03a24b483c
parent395d16e4381d0c96d30d3daff806ac7113de9a5f (diff)
downloadmcwm-4628d948a1806e89cdacfae7e59e229e3b758187.zip
In some cases focuswin isn't NULL but is on another workspace. A bug,
but needs to be handled.
-rw-r--r--mcwm.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/mcwm.c b/mcwm.c
index 56f6416..f5c03c0 100644
--- a/mcwm.c
+++ b/mcwm.c
@@ -520,13 +520,13 @@ void changeworkspace(uint32_t ws)
PDEBUG("Changing from workspace #%d to #%d\n", curws, ws);
/*
- * We lose our focus temporarily if the window we focus isn't
- * fixed. An EnterNotify event will get our focus back later.
+ * We lose our focus if the window we focus isn't fixed. An
+ * EnterNotify event will set focus later.
*/
if (NULL != focuswin && !focuswin->fixed)
{
setunfocus(focuswin->id);
- focuswin = NULL;
+ focuswin = NULL;
}
/* Go through list of current ws. Unmap everything that isn't fixed. */
@@ -1260,15 +1260,19 @@ void focusnext(void)
}
/* If we currently have no focus focus first in list. */
- if (NULL == focuswin)
+ if (NULL == focuswin || NULL == focuswin->wsitem[curws])
{
PDEBUG("Focusing first in list: %p\n", wslist[curws]);
client = wslist[curws]->data;
+
+ if (NULL != focuswin && NULL == focuswin->wsitem[curws])
+ {
+ PDEBUG("XXX Our focused window %d isn't on this workspace!\n",
+ focuswin->id);
+ }
}
else
{
- assert(NULL != focuswin->wsitem[curws]);
-
if (NULL == focuswin->wsitem[curws]->next)
{
/*