diff options
author | Michael Cardell Widerkrantz <mc@hack.org> | 2011-03-04 14:22:00 +0100 |
---|---|---|
committer | Michael Cardell Widerkrantz <mc@hack.org> | 2011-03-08 12:14:38 +0100 |
commit | 4628d948a1806e89cdacfae7e59e229e3b758187 (patch) | |
tree | 2fc4f367039266a39e27916d7766af03a24b483c /mcwm.c | |
parent | 395d16e4381d0c96d30d3daff806ac7113de9a5f (diff) | |
download | mcwm-4628d948a1806e89cdacfae7e59e229e3b758187.zip |
In some cases focuswin isn't NULL but is on another workspace. A bug,
but needs to be handled.
Diffstat (limited to 'mcwm.c')
-rw-r--r-- | mcwm.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -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) { /* |