From 309a1aafb36ba4c90d9cf4d0c635aed919fb5aa2 Mon Sep 17 00:00:00 2001 From: simonb Date: Mon, 27 Mar 2006 06:26:34 +0000 Subject: fix crash when deiconfiy mode = Follow --- ChangeLog | 3 +++ src/IconButton.cc | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 73ff7ff..7d4d209 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 0.9.16: +*06/03/27: + * Fix crash when deiconifying stuck windows with Follow mode (Simon) + IconButton.cc *06/03/26: * Related to external (Simon) - Fix title alignment diff --git a/src/IconButton.cc b/src/IconButton.cc index fa85cb2..edc2fc1 100644 --- a/src/IconButton.cc +++ b/src/IconButton.cc @@ -74,26 +74,29 @@ public: explicit FocusCommand(const IconbarTool& tool, FluxboxWindow &win) : m_win(win), m_tool(tool) { } void execute() { - if(m_win.isIconic() || !m_win.isFocused()) { + // this needs to be a local variable, as this object could be destroyed + // if the workspace is changed. + FluxboxWindow &win = m_win; + if(win.isIconic() || !win.isFocused()) { switch(m_tool.deiconifyMode()) { case IconbarTool::SEMIFOLLOW: - if (m_win.isIconic()) { - m_win.screen().sendToWorkspace(m_win.screen().currentWorkspaceID(), &m_win); + if (win.isIconic()) { + win.screen().sendToWorkspace(win.screen().currentWorkspaceID(), &win); } else { - m_win.screen().changeWorkspaceID(m_win.workspaceNumber()); + win.screen().changeWorkspaceID(win.workspaceNumber()); } break; case IconbarTool::CURRENT: - m_win.screen().sendToWorkspace(m_win.screen().currentWorkspaceID(), &m_win); + win.screen().sendToWorkspace(win.screen().currentWorkspaceID(), &win); break; case IconbarTool::FOLLOW: default: - m_win.screen().changeWorkspaceID(m_win.workspaceNumber()); + win.screen().changeWorkspaceID(win.workspaceNumber()); break; }; - m_win.raiseAndFocus(); + win.raiseAndFocus(); } else - m_win.iconify(); + win.iconify(); } private: -- cgit v0.11.2