Simon's last changes lead to segfaults when the users specified <Sticky> or

<Workspace> in apps-file. Reason is, that an unmanaged window is not yet
assigned to an workspace and thus the returned workspacenumber is -1 ... which
leads in combination with getWorkspace(nr) to an invalid workspace (0x0) ...
This also fixes the problem with several deiconify-modes of the iconbar, when
the iconbar is in icons-only mode (same reason)

The other changes in the files are just cosmetic, i throw out the comments
about the changes Simon did coz they make sense and are correct imho.
This commit is contained in:
mathias 2005-01-05 01:56:19 +00:00
parent 1657de3cef
commit 0c74e8c935
2 changed files with 9 additions and 25 deletions

View file

@ -81,20 +81,17 @@ public:
m_win.screen().sendToWorkspace(m_win.screen().currentWorkspaceID(), &m_win);
} else {
m_win.screen().changeWorkspaceID(m_win.workspaceNumber());
m_win.raiseAndFocus();
}
break;
case IconbarTool::CURRENT:
m_win.screen().sendToWorkspace(m_win.screen().currentWorkspaceID(), &m_win);
m_win.raiseAndFocus();
break;
case IconbarTool::FOLLOW:
default:
m_win.screen().changeWorkspaceID(m_win.workspaceNumber());
m_win.raiseAndFocus();
break;
};
m_win.raiseAndFocus();
} else
m_win.iconify();
}

View file

@ -1220,10 +1220,6 @@ FluxboxWindow *BScreen::createWindow(Window client) {
else
focused_list.push_back(&win->winClient());
// if (new_win) {
// Fluxbox::instance()->attachSignals(*win);
// }
// we also need to check if another window expects this window to the left
// and if so, then join it.
FluxboxWindow *otherwin = 0;
@ -1242,11 +1238,6 @@ FluxboxWindow *BScreen::createWindow(Window client) {
FluxboxWindow *BScreen::createWindow(WinClient &client) {
if (isKdeDockapp(client.window()) && addKdeDockapp(client.window())) {
// we need to save old handler and readd it later
// I think rearranging the logic negates the need for this - sb 04jan2005
// FbTk::EventManager *evm = FbTk::EventManager::instance();
// FbTk::EventHandler *evh = evm->find(client.window());
// evm->add(*evh, client.window());
return 0;
}
@ -1254,24 +1245,17 @@ FluxboxWindow *BScreen::createWindow(WinClient &client) {
winFrameTheme(),
*layerManager().getLayer(Fluxbox::instance()->getNormalLayer()));
// Why not KDE? - sb 04jan2005
// if (!isKdeDockapp(client.window())) {
#ifdef SLIT
if (win->initialState() == WithdrawnState && slit() != 0) {
slit()->addClient(win->clientWindow());
}
if (win->initialState() == WithdrawnState && slit() != 0) {
slit()->addClient(win->clientWindow());
}
#endif // SLIT
// }
if (!win->isManaged()) {
delete win;
return 0;
}
// don't add to focused_list, as it should already be in there (since the
// WinClient already exists).
// Fluxbox::instance()->attachSignals(*win);
m_clientlist_sig.notify();
@ -1355,7 +1339,10 @@ void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id,
// gets updated
m_clientlist_sig.notify();
} else if (ignore_sticky || ! w->isStuck()) {
getWorkspace(w->workspaceNumber())->removeWindow(w, true);
// fresh windows have workspaceNumber == -1, which leads to
// an invalid workspace (unsigned int)
if (getWorkspace(w->workspaceNumber()))
getWorkspace(w->workspaceNumber())->removeWindow(w, true);
getWorkspace(wkspc_id)->addWindow(*w);
// see comment above
m_clientlist_sig.notify();