aboutsummaryrefslogtreecommitdiff
path: root/src/Remember.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-04-28 12:58:08 (GMT)
committerrathnor <rathnor>2003-04-28 12:58:08 (GMT)
commitaf8510a5a7da755a0677405c7d009ad01e6d67a6 (patch)
treefeb3bd0f24d67d31d5c788d147d40a64bc15a49d /src/Remember.cc
parent93fab45accee2f5d0375f6686269e8cd9a588ab9 (diff)
downloadfluxbox-af8510a5a7da755a0677405c7d009ad01e6d67a6.zip
fluxbox-af8510a5a7da755a0677405c7d009ad01e6d67a6.tar.bz2
fix detachClient issue where the menu wouldn't get created before adding
remember. Also make this safer in Remember.cc
Diffstat (limited to 'src/Remember.cc')
-rw-r--r--src/Remember.cc8
1 files changed, 5 insertions, 3 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 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: Remember.cc,v 1.9 2003/04/27 15:53:53 rathnor Exp $ 23// $Id: Remember.cc,v 1.10 2003/04/28 12:58:08 rathnor Exp $
24 24
25#include "Remember.hh" 25#include "Remember.hh"
26#include "StringUtil.hh" 26#include "StringUtil.hh"
@@ -545,12 +545,14 @@ void Remember::setupWindow(FluxboxWindow &win) {
545 545
546 // we don't touch the window if it is a transient 546 // we don't touch the window if it is a transient
547 // of something else 547 // of something else
548 int menupos = win.getWindowmenu().numberOfItems()-2;
549 if (menupos < -1) menupos = -1;
548 if (winclient.transientFor()) { 550 if (winclient.transientFor()) {
549 // still put something in the menu so people don't get confused 551 // still put something in the menu so people don't get confused
550 // so, we add a disabled item... 552 // so, we add a disabled item...
551 FbTk::MenuItem *item = new FbTk::MenuItem("Remember..."); 553 FbTk::MenuItem *item = new FbTk::MenuItem("Remember...");
552 item->setEnabled(false); 554 item->setEnabled(false);
553 win.getWindowmenu().insert(item, win.getWindowmenu().numberOfItems()-2); 555 win.getWindowmenu().insert(item, menupos);
554 win.getWindowmenu().update(); 556 win.getWindowmenu().update();
555 return; 557 return;
556 } 558 }
@@ -560,7 +562,7 @@ void Remember::setupWindow(FluxboxWindow &win) {
560 // TODO: nls 562 // TODO: nls
561 win.getWindowmenu().insert("Remember...", 563 win.getWindowmenu().insert("Remember...",
562 createRememberMenu(*this, win), 564 createRememberMenu(*this, win),
563 win.getWindowmenu().numberOfItems()-2); 565 menupos);
564 win.getWindowmenu().update(); 566 win.getWindowmenu().update();
565 567
566 Application *app = find(winclient); 568 Application *app = find(winclient);