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.
mathias mathias
2 files changed,
9 insertions(+),
25 deletions(-)
M
src/IconButton.cc
→
src/IconButton.cc
@@ -81,20 +81,17 @@ if (m_win.isIconic()) {
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(); }
M
src/Screen.cc
→
src/Screen.cc
@@ -1219,11 +1219,7 @@ if (doFocusNew())
focused_list.push_front(&win->winClient()); 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(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 *win = new FluxboxWindow(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 @@ // show whats on current/other workspace
// 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();