aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2004-08-29 12:35:29 (GMT)
committerrathnor <rathnor>2004-08-29 12:35:29 (GMT)
commitef9565efd8431eed3f561154c58765d5a77be90a (patch)
treedc0de9202454de040cd88db5e076d1ded565a4e7 /src/Window.cc
parent92dc8d745214ac4f8c81bbad6d529a19fb4fe46c (diff)
downloadfluxbox-ef9565efd8431eed3f561154c58765d5a77be90a.zip
fluxbox-ef9565efd8431eed3f561154c58765d5a77be90a.tar.bz2
fix crash bug when windowmenu doesn't include extramenus
improve checking of existence/success of loading windowmenu file
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 2528a8c..c3f6190 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.cc,v 1.296 2004/08/13 12:39:02 fluxgen Exp $ 25// $Id: Window.cc,v 1.297 2004/08/29 12:35:29 rathnor Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -350,7 +350,14 @@ FluxboxWindow::~FluxboxWindow() {
350 // still in the menu 350 // still in the menu
351 // (They need to be internal for most of the time so that if we 351 // (They need to be internal for most of the time so that if we
352 // rebuild the menu, then they won't be removed. 352 // rebuild the menu, then they won't be removed.
353 mit->second->setInternalMenu(false); 353 if (mit->second->parent() == 0) {
354 // not attached to our windowmenu
355 // so we clean it up
356 delete mit->second;
357 } else {
358 // let the parent clean it up
359 mit->second->setInternalMenu(false);
360 }
354 } 361 }
355 362
356#ifdef DEBUG 363#ifdef DEBUG
@@ -3562,9 +3569,10 @@ void FluxboxWindow::setupMenu() {
3562 menu().removeAll(); // clear old items 3569 menu().removeAll(); // clear old items
3563 menu().disableTitle(); // not titlebar 3570 menu().disableTitle(); // not titlebar
3564 3571
3565 if (!screen().windowMenuFilename().empty()) { 3572 if (screen().windowMenuFilename().empty() ||
3566 MenuCreator::createFromFile(screen().windowMenuFilename(), menu(), *this); 3573 ! MenuCreator::createFromFile(screen().windowMenuFilename(), menu(), *this))
3567 } else { 3574
3575 {
3568 MenuCreator::createWindowMenuItem("shade", "", menu(), *this); 3576 MenuCreator::createWindowMenuItem("shade", "", menu(), *this);
3569 MenuCreator::createWindowMenuItem("stick", "", menu(), *this); 3577 MenuCreator::createWindowMenuItem("stick", "", menu(), *this);
3570 MenuCreator::createWindowMenuItem("maximize", "", menu(), *this); 3578 MenuCreator::createWindowMenuItem("maximize", "", menu(), *this);