From 0c74e8c9355f6f70d426edaacafd296331aa3523 Mon Sep 17 00:00:00 2001 From: mathias Date: Wed, 5 Jan 2005 01:56:19 +0000 Subject: Simon's last changes lead to segfaults when the users specified or 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. --- src/IconButton.cc | 5 +---- src/Screen.cc | 29 ++++++++--------------------- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/src/IconButton.cc b/src/IconButton.cc index 24bdddf..40310e6 100644 --- a/src/IconButton.cc +++ b/src/IconButton.cc @@ -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(); } diff --git a/src/Screen.cc b/src/Screen.cc index dee150b..91e3c9f 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1219,11 +1219,7 @@ FluxboxWindow *BScreen::createWindow(Window client) { 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(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(); -- cgit v0.11.2