Add my copyright to files I've modified.
[synfig.git] / synfig-studio / trunk / src / gtkmm / dockdialog.cpp
index 803fa98..1a9a6e4 100644 (file)
@@ -2,10 +2,11 @@
 /*!    \file dockdialog.cpp
 **     \brief Template File
 **
-**     $Id: dockdialog.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
+**     $Id$
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+**     Copyright (c) 2007 Chris Moore
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
@@ -35,6 +36,7 @@
 #include "dockdialog.h"
 #include "dockbook.h"
 #include "dockmanager.h"
+#include "toolbox.h"
 #include "widget_compselect.h"
 #include <synfig/general.h>
 #include <synfig/uniqueid.h>
@@ -100,6 +102,12 @@ DockDialog::DockDialog():
        );
        set_keep_above(false);
 
+       //! \todo can we set dialog windows transient for all normal windows, not just the toolbox?
+       //! paragraph 3 of http://standards.freedesktop.org/wm-spec/1.3/ar01s07.html suggests we can
+       // this seems to have bad effects on KDE, so leave it disabled by default
+       if(getenv("SYNFIG_TRANSIENT_DIALOGS"))
+               set_transient_for(*App::toolbox);
+
        // Set up the window
        //set_type_hint(Gdk::WINDOW_TYPE_HINT_UTILITY);
        set_title("Dock Dialog");
@@ -137,14 +145,12 @@ DockDialog::~DockDialog()
 
        is_deleting=true;
 
-       DEBUGPOINT();
-
        // Remove all of the dock books
        for(;!dock_book_list.empty();dock_book_list.pop_front())
        {
                dock_book_list.front()->clear();
 
-               // UGLY HACK
+               //! \fixme: UGLY HACK
                // The following line really should be uncommented,
                // but it causes crashes. Without it, a small
                // memory hole is created--but at least it doesn't crash
@@ -153,8 +159,14 @@ DockDialog::~DockDialog()
                // Oddly enough, the following line should
                // theoreticly do the same thing after this
                // class is destroyed, but it doesn't seem to
-               // caues a crash.
-               manage(dock_book_list.front());
+               // cause a crash.  It does, however, trigger this warning:
+               //
+               //   A floating object was finalized. This means that someone
+               //   called g_object_unref() on an object that had only a
+               //   floating reference; the initial floating reference is not
+               //   owned by anyone and must be removed with g_object_ref_sink().
+               //
+               // manage(dock_book_list.front());
        }
 
        // Remove us from the dock manager
@@ -173,8 +185,6 @@ DockDialog::~DockDialog()
        }
 
        delete widget_comp_select;
-
-       DEBUGPOINT();
 }
 
 void
@@ -292,7 +302,7 @@ DockDialog::erase_dock_book(DockBook* dock_book)
 void
 DockDialog::refresh()
 {
-       synfig::info("dock_book_list.size()=%d",dock_book_list.size());
+       // synfig::info("dock_book_list.size()=%d",dock_book_list.size());
        //remove();
 
        if(dock_book_list.empty())