git-gui: Don't delete console window namespaces too early
If the console finishes displaying its output and is "done" but needs to draw a scrollbar to show the final output messages it is possible for Tk to delete the window namespace before it does the text widget updates, which means we are unable to add the horizontal or vertical scrollbar to the window when the text widget decides it cannot draw all glyphs on screen. We need to delay deleting the window namespace until we know the window is not going to ever be used again. This occurs if we are done receiving output, the command is successful and the window is closed, or if the window is open and the user chooses to close the window after the command has completed. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Sep 26, 2007 at 14:05 UTC
6f2d73ec0cb6d5937bb4a62a222f942e4f886d6e
1 file changed
+4
-1
lib/console.tcl
+4
-1
@@ -179,23 +179,26 @@ method insert {txt} {
179
method done {ok} {
180
if {$ok} {
181
if {[winfo exists $w.m.s]} {
182
+ bind $w.m.s <Destroy> [list delete_this $this]
183
$w.m.s conf -background green -text [mc "Success"]
184
if {$is_toplevel} {
185
$w.ok conf -state normal
186
focus $w.ok
187
}
188
+ } else {
189
+ delete_this
190
}
191
} else {
192
if {![winfo exists $w.m.s]} {
193
_init $this
194
}
195
+ bind $w.m.s <Destroy> [list delete_this $this]
196
$w.m.s conf -background red -text [mc "Error: Command Failed"]
197
if {$is_toplevel} {
198
$w.ok conf -state normal
199
focus $w.ok
200
}
201
}
198
- delete_this
202
}
203
204
method _sb_set {sb orient first last} {