aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonb <simonb>2006-03-27 06:26:34 (GMT)
committersimonb <simonb>2006-03-27 06:26:34 (GMT)
commit309a1aafb36ba4c90d9cf4d0c635aed919fb5aa2 (patch)
tree4cb5d87ef014541ff4213f41ae0c0e8f2d50f490
parent744c82cb1c2f0ad0b86c732ad1f7b6124f73dfec (diff)
downloadfluxbox-309a1aafb36ba4c90d9cf4d0c635aed919fb5aa2.zip
fluxbox-309a1aafb36ba4c90d9cf4d0c635aed919fb5aa2.tar.bz2
fix crash when deiconfiy mode = Follow
-rw-r--r--ChangeLog3
-rw-r--r--src/IconButton.cc19
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 @@
1(Format: Year/Month/Day) 1(Format: Year/Month/Day)
2Changes for 0.9.16: 2Changes for 0.9.16:
3*06/03/27:
4 * Fix crash when deiconifying stuck windows with Follow mode (Simon)
5 IconButton.cc
3*06/03/26: 6*06/03/26:
4 * Related to external (Simon) 7 * Related to external (Simon)
5 - Fix title alignment 8 - 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:
74 explicit FocusCommand(const IconbarTool& tool, FluxboxWindow &win) : 74 explicit FocusCommand(const IconbarTool& tool, FluxboxWindow &win) :
75 m_win(win), m_tool(tool) { } 75 m_win(win), m_tool(tool) { }
76 void execute() { 76 void execute() {
77 if(m_win.isIconic() || !m_win.isFocused()) { 77 // this needs to be a local variable, as this object could be destroyed
78 // if the workspace is changed.
79 FluxboxWindow &win = m_win;
80 if(win.isIconic() || !win.isFocused()) {
78 switch(m_tool.deiconifyMode()) { 81 switch(m_tool.deiconifyMode()) {
79 case IconbarTool::SEMIFOLLOW: 82 case IconbarTool::SEMIFOLLOW:
80 if (m_win.isIconic()) { 83 if (win.isIconic()) {
81 m_win.screen().sendToWorkspace(m_win.screen().currentWorkspaceID(), &m_win); 84 win.screen().sendToWorkspace(win.screen().currentWorkspaceID(), &win);
82 } else { 85 } else {
83 m_win.screen().changeWorkspaceID(m_win.workspaceNumber()); 86 win.screen().changeWorkspaceID(win.workspaceNumber());
84 } 87 }
85 break; 88 break;
86 case IconbarTool::CURRENT: 89 case IconbarTool::CURRENT:
87 m_win.screen().sendToWorkspace(m_win.screen().currentWorkspaceID(), &m_win); 90 win.screen().sendToWorkspace(win.screen().currentWorkspaceID(), &win);
88 break; 91 break;
89 case IconbarTool::FOLLOW: 92 case IconbarTool::FOLLOW:
90 default: 93 default:
91 m_win.screen().changeWorkspaceID(m_win.workspaceNumber()); 94 win.screen().changeWorkspaceID(win.workspaceNumber());
92 break; 95 break;
93 }; 96 };
94 m_win.raiseAndFocus(); 97 win.raiseAndFocus();
95 } else 98 } else
96 m_win.iconify(); 99 win.iconify();
97 } 100 }
98 101
99private: 102private: