git-gui: Paper bag fix error dialogs opening over the main window
authorShawn O. Pearce <spearce@spearce.org>
Thu, 21 Feb 2008 17:22:08 +0000 (12:22 -0500)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 22 Feb 2008 06:35:23 +0000 (01:35 -0500)
If the main window is the only toplevel we have open then we
don't have a valid grab right now, so we need to assume the
best toplevel to use for the parent is ".".

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
lib/error.tcl

index 45800d54932bf1367cff81db040d1a14b87a9ab5..08a24622c7ff199399805ef34f0396f6cb81613c 100644 (file)
@@ -2,7 +2,11 @@
 # Copyright (C) 2006, 2007 Shawn Pearce
 
 proc _error_parent {} {
-       return [grab current .]
+       set p [grab current .]
+       if {$p eq {}} {
+               return .
+       }
+       return $p
 }
 
 proc error_popup {msg} {