#323 remove last workspace' doesn't add win names to menu

open
nobody
None
5
2007-08-22
2007-08-22
daneli
No

The "remove last workspace" option in the Workspaces menu is supposed to move the windows on the last workspace to the workspace which is before the last workspace. (E.g. windows in Workspace 4 would be moved to Workspace 3.) At the same time, the windows which are moved from Workspace 4 to Workspace 3 are supposed to be added to the list of windows in the "Workspace 3" window menu list. The second part of this doesn't happen however, so if you remove Workspace 4 and look in the menu for Workspace 3, it appears that all the windows from Workspace 4 have disappeared.

I think the problem lies in the following code from 'void BScreen::removeLastWorkspace(void)' in Screen.cc:

if (workspacesList.size() == 1)
return;
Workspace *workspace = workspacesList.back();
BlackboxWindowList::iterator it = windowList.begin();
const BlackboxWindowList::iterator end = windowList.end();
for (; it != end; ++it) {
BlackboxWindow * const win = *it;
if (win->workspace() == workspace->id())
win->setWorkspace(workspace->id() - 1);

I believe the last line above should be changed to

win->changeWorkspace(workspace->id() - 1);

Making that change seemed to fix the problem for me.

Thanks,

dan

Discussion