all repos — fluxbox @ 309a1aafb36ba4c90d9cf4d0c635aed919fb5aa2

custom fork of the fluxbox windowmanager

fix crash when deiconfiy mode = Follow
simonb simonb
commit

309a1aafb36ba4c90d9cf4d0c635aed919fb5aa2

parent

744c82cb1c2f0ad0b86c732ad1f7b6124f73dfec

2 files changed, 14 insertions(+), 8 deletions(-)

jump to
M ChangeLogChangeLog

@@ -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
M src/IconButton.ccsrc/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: