This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[RFA] gdbtk/library/managedwin.itb: Don't grow source window on Cygwin


On Cygwin, each Insight run expands the source window vertically by 19
pixels.  This happens because:

  1. Window geometries are saved as gdbtk.ini preferences during
     ManagedWin window destructor callbacks.

  2. The source window's menu bar is deleted before the source window's
     destructor is called.

  3. On Windows, a window's menu bar is deleted by calling SetMenu(),
     which has the side-effect of expanding the window by the menu bar
     height.

  4. Therefore, the source window's menu bar height (19 pixels) is added
     to the source window before its window geometry is saved as a
     gdbtk.ini preference.

The appended patch fixes that by moving the geometry save operation from
ManagedWin::destructor to ManagedWin::shutdown.

gdbtk/ChangeLog:

	* library/managedwin.itb (ManagedWin::shutdown): Save each
	managed window's geometry as a preference.
	* library/managedwin.ith (ManagedWin::destructor): Don't save
	managed windows' geometries as preferences.

Okay to apply?

Nicholas Duffek
<nsd@redhat.com>

[patch follows]

Index: gdb/gdbtk/library/managedwin.itb
===================================================================
diff -up gdb/gdbtk/library/managedwin.itb gdb/gdbtk/library/managedwin.itb
--- gdb/gdbtk/library/managedwin.itb	Sun Feb 25 02:35:16 2001
+++ gdb/gdbtk/library/managedwin.itb	Sun Feb 25 02:35:10 2001
@@ -71,6 +71,8 @@ body ManagedWin::shutdown {} {
   set activeWins {}
   foreach win $manage_active {
     if {[$win isa ManagedWin]} {
+      set g [wm geometry [winfo toplevel [namespace tail $win]]]
+      pref setd gdb/geometry/[namespace tail $win] $g
       lappend activeWins [$win pickle]
     }
   }
Index: gdb/gdbtk/library/managedwin.ith
===================================================================
diff -up gdb/gdbtk/library/managedwin.ith gdb/gdbtk/library/managedwin.ith
--- gdb/gdbtk/library/managedwin.ith	Sun Feb 25 02:35:21 2001
+++ gdb/gdbtk/library/managedwin.ith	Sun Feb 25 02:35:10 2001
@@ -81,21 +81,11 @@ class ManagedWin {
       set manage_active [lreplace $manage_active $i $i]
     }
 
-    # save geometry
-    set g [wm geometry [winfo toplevel [namespace tail $this]]]
-    pref setd gdb/geometry/[namespace tail $this] $g
-
     # If no toplevels remain, quit.  However, check the quit_if_last
     # flag since we might be doing something like displaying a 
     # splash screen at startup...
 
     if {!$numTopWins && [quit_if_last]} {
-      # save window positions of remaining windows
-      foreach obj $manage_active {
-	set g [wm geometry [winfo toplevel [namespace tail $obj]]]
-	pref setd gdb/geometry/[namespace tail $obj] $g
-      }
-      pref_save
       gdb_force_quit
     } else {
       destroy_toplevel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]