From f6c5f7e9abbf808fb446a38ff1285b54510a04ed Mon Sep 17 00:00:00 2001 From: markt Date: Wed, 18 Jul 2007 22:17:19 +0000 Subject: fix bug with SemiFollow --- src/ClientMenu.cc | 7 ++++++- src/FbTk/Menu.cc | 1 + src/Screen.cc | 2 +- src/Window.cc | 16 ++-------------- src/Window.hh | 2 -- src/Workspace.cc | 2 +- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/ClientMenu.cc b/src/ClientMenu.cc index c70da85..ae35aab 100644 --- a/src/ClientMenu.cc +++ b/src/ClientMenu.cc @@ -46,9 +46,14 @@ public: FluxboxWindow *fbwin = m_client.fbwindow(); if (fbwin == 0) return; + + // this MenuItem object can get destroyed as a result of focus(), so we + // must get a local copy of the parent menu + FbTk::Menu *parent = menu(); + m_client.focus(); fbwin->raise(); - menu()->hide(); + parent->hide(); } const std::string &label() const { return m_client.title(); } diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index 0559f0d..f10f1b7 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc @@ -111,6 +111,7 @@ Menu::Menu(MenuTheme &tm, ImageControl &imgctrl): m_internal_menu = m_moving = + m_closing = m_torn = m_visible = false; diff --git a/src/Screen.cc b/src/Screen.cc index 9a7d433..a87a842 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1329,7 +1329,7 @@ void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS if (id == currentWorkspace()->workspaceID() && !win->isIconic()) win->deiconify(false, false); else { - win->withdraw(true); + win->hide(true); FocusControl::revertFocus(*this); } diff --git a/src/Window.cc b/src/Window.cc index 74deb9b..9ec92c4 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -1389,7 +1389,7 @@ bool FluxboxWindow::focus() { // fetch the window to the current workspace if (model == BScreen::FETCH_ACTIVE_WINDOW || (isIconic() && model == BScreen::SEMIFOLLOW_ACTIVE_WINDOW)) - screen().sendToWorkspace(screen().currentWorkspaceID(), this, true); + screen().sendToWorkspace(screen().currentWorkspaceID(), this, false); // warp to the workspace of the window else screen().changeWorkspaceID(workspaceNumber()); @@ -1586,18 +1586,6 @@ void FluxboxWindow::deiconify(bool reassoc, bool do_raise) { raise(); } -/** - Set window in withdrawn state -*/ -void FluxboxWindow::withdraw(bool interrupt_moving) { -#ifdef DEBUG - cerr<<"FluxboxWindow::"<<__FUNCTION__<<": this = "<isStuck()) - (*it)->withdraw(interrupt_moving); + (*it)->hide(interrupt_moving); } } -- cgit v0.11.2