From af8510a5a7da755a0677405c7d009ad01e6d67a6 Mon Sep 17 00:00:00 2001 From: rathnor Date: Mon, 28 Apr 2003 12:58:08 +0000 Subject: fix detachClient issue where the menu wouldn't get created before adding remember. Also make this safer in Remember.cc --- src/Remember.cc | 8 +++++--- src/Screen.cc | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Remember.cc b/src/Remember.cc index cbd8f59..27c604a 100644 --- a/src/Remember.cc +++ b/src/Remember.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Remember.cc,v 1.9 2003/04/27 15:53:53 rathnor Exp $ +// $Id: Remember.cc,v 1.10 2003/04/28 12:58:08 rathnor Exp $ #include "Remember.hh" #include "StringUtil.hh" @@ -545,12 +545,14 @@ void Remember::setupWindow(FluxboxWindow &win) { // we don't touch the window if it is a transient // of something else + int menupos = win.getWindowmenu().numberOfItems()-2; + if (menupos < -1) menupos = -1; if (winclient.transientFor()) { // still put something in the menu so people don't get confused // so, we add a disabled item... FbTk::MenuItem *item = new FbTk::MenuItem("Remember..."); item->setEnabled(false); - win.getWindowmenu().insert(item, win.getWindowmenu().numberOfItems()-2); + win.getWindowmenu().insert(item, menupos); win.getWindowmenu().update(); return; } @@ -560,7 +562,7 @@ void Remember::setupWindow(FluxboxWindow &win) { // TODO: nls win.getWindowmenu().insert("Remember...", createRememberMenu(*this, win), - win.getWindowmenu().numberOfItems()-2); + menupos); win.getWindowmenu().update(); Application *app = find(winclient); diff --git a/src/Screen.cc b/src/Screen.cc index 00615e6..4c9c93e 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.140 2003/04/28 00:36:50 fluxgen Exp $ +// $Id: Screen.cc,v 1.141 2003/04/28 12:58:08 rathnor Exp $ #include "Screen.hh" @@ -1291,8 +1291,8 @@ FluxboxWindow *BScreen::createWindow(WinClient &client) { // WinClient already exists). Fluxbox::instance()->saveWindowSearch(client.window(), win); - Fluxbox::instance()->attachSignals(*win); setupWindowActions(*win); + Fluxbox::instance()->attachSignals(*win); if (win->getWorkspaceNumber() == getCurrentWorkspaceID() || win->isStuck()) { win->show(); } -- cgit v0.11.2