git-gui: Don't crash in ask_popup if we haven't mapped main window yet
If we have more than our desired number of objects and we try to open the "Do you want to repack now?" dialog we cannot include a -parent . argument if the main window has not been mapped yet. On Mac OS X it appears this window isn't mapped right away, so we had better hang avoid including it. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Jul 17, 2007 at 22:45 UTC
2370164f3ceb833b9b4128d80bdfcc81e58682f9
1 file changed
+5
-2
lib/error.tcl
+5
-2
@@ -51,12 +51,15 @@ proc ask_popup {msg} {
51
if {[reponame] ne {}} {
52
append title " ([reponame])"
53
}
54
- return [tk_messageBox \
55
- -parent . \
54
+ set cmd [list tk_messageBox \
55
-icon question \
56
-type yesno \
57
-title $title \
58
-message $msg]
59
+ if {[winfo ismapped .]} {
60
+ lappend cmd -parent .
61
+ }
62
+ eval $cmd
63
}
64
65
proc hook_failed_popup {hook msg} {