fix infinite loop caused by deiconify command

This commit is contained in:
markt 2007-05-04 17:13:50 +00:00
parent 5eb658a51f
commit db2904e144
3 changed files with 9 additions and 3 deletions

View file

@ -1,5 +1,8 @@
(Format: Year/Month/Day)
Changes for 1.0.0:
*07/05/04:
* Fixed infinite loop caused by deiconify command (Mark)
FbCommands.cc
*07/04/24:
* Fixed a bug in parsing cli (Mathias, thanks to Steven Kah Hien Wong <steven at
zensaki dot com> for pointing out the issue)

View file

@ -394,8 +394,11 @@ void DeiconifyCmd::execute() {
if (screen == 0)
return;
BScreen::Icons::reverse_iterator it= screen->iconList().rbegin();
BScreen::Icons::reverse_iterator itend= screen->iconList().rend();
// we need to make a copy of the list of icons, or else our iterator can
// become invalid
BScreen::Icons icon_list = screen->iconList();
BScreen::Icons::iterator it = icon_list.begin();
BScreen::Icons::iterator itend= icon_list.end();
unsigned int workspace_num= screen->currentWorkspaceID();
unsigned int old_workspace_num;

View file

@ -458,7 +458,7 @@ void FluxboxWindow::init() {
restoreAttributes();
if (m_workspace_number < 0 || m_workspace_number >= screen().numberOfWorkspaces())
if (m_workspace_number >= screen().numberOfWorkspaces())
m_workspace_number = screen().currentWorkspaceID();
bool place_window = (m_old_pos_x == static_cast<signed>(m_screen.width()));