OSDN Git Service

* managedwin.itb (ManagedWin::startup): Only open source window
authortromey <tromey>
Mon, 11 Dec 2000 18:40:12 +0000 (18:40 +0000)
committertromey <tromey>
Mon, 11 Dec 2000 18:40:12 +0000 (18:40 +0000)
if it doesn't already exist.

gdb/gdbtk/library/ChangeLog
gdb/gdbtk/library/managedwin.itb

index 7d895e9..88232d9 100644 (file)
@@ -1,5 +1,8 @@
 2000-12-08  Tom Tromey  <tromey@redhat.com>
 
+       * managedwin.itb (ManagedWin::startup): Only open source window
+       if it doesn't already exist.
+
        * toolbar.tcl (create_help_menu): Remove `Cygnus' item.
 
        * console.itb (Console::invoke): Trim trailing newlines from
index 7eb23c5..42c0f32 100644 (file)
@@ -88,7 +88,16 @@ body ManagedWin::startup {} {
   foreach cmd [pref get gdb/window/active] {
     eval $cmd
   }
-  ManagedWin::open SrcWin
+  # If we open the source window, and a source window already exists,
+  # then we end up raising it twice during startup.  This yields an
+  # annoying effect for the user: if the user tries the bury the
+  # source window during startup, it will raise itself again.  This
+  # explains why we first check to see if a source window exists
+  # before trying to create it -- raising the window is an inevitable
+  # side effect of the creation process.
+  if {[llength [find SrcWin]] == 0} {
+    ManagedWin::open SrcWin
+  }
 }
 
 body ManagedWin::open_dlg {class args} {
@@ -119,7 +128,7 @@ body ManagedWin::_open { class args } {
   debug "$class $args"
   
   parse_args force
-  
+
   if {!$force} {
     # check all windows for one of this type
     foreach obj $manage_active {