all repos — fluxbox @ e7a5539b29e23bb0b686b4a06bf1e8cc3133c95c

custom fork of the fluxbox windowmanager

fix crash from removeClient if window wasn't the active client
rathnor rathnor
commit

e7a5539b29e23bb0b686b4a06bf1e8cc3133c95c

parent

d63bf127ad6391f3e8408ddfd0ba79c4841a1ecf

2 files changed, 17 insertions(+), 7 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,6 +1,8 @@

(Format: Year/Month/Day) Changes for 0.9.2: *03/05/07: + * Fix crash when detaching client that isn't active (Simon) + Window.cc * Fixed transient grouping issues (transients now WinClients) (Simon) WinClient.hh/cc Window.hh/cc Workspace.cc Screen.cc * Fixed screen problem with redrawing menus (Henrik)
M src/Window.ccsrc/Window.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.160 2003/05/07 16:21:26 rathnor Exp $ +// $Id: Window.cc,v 1.161 2003/05/07 16:44:51 rathnor Exp $ #include "Window.hh"

@@ -631,18 +631,26 @@ #ifdef DEBUG

cerr<<__FILE__<<"("<<__FUNCTION__<<")["<<this<<"]"<<endl; #endif // DEBUG + // if it is our active client, deal with it... + if (m_client == &client) { // set next client to be focused // if the client we're about to remove is the last client then set prev client - if (&client == m_clientlist.back()) - prevClient(); - else - nextClient(); + if (&client == m_clientlist.back()) + prevClient(); + else + nextClient(); + } client.m_win = 0; m_clientlist.remove(&client); - if (m_client == &client && m_clientlist.empty()) - m_client = 0; + if (m_client == &client) { + if (m_clientlist.empty()) + m_client = 0; + else + // this really shouldn't happen + m_client = m_clientlist.back(); + } FbTk::EventManager &evm = *FbTk::EventManager::instance(); evm.remove(client.window());