From: Shawn O. Pearce Date: Thu, 21 Feb 2008 17:22:08 +0000 (-0500) Subject: git-gui: Paper bag fix error dialogs opening over the main window X-Git-Tag: v1.5.4.3~1^2~3 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/85ec3e7778c09f5d4f52a29f57c5ecc64070ffd1?ds=inline;hp=--cc git-gui: Paper bag fix error dialogs opening over the main window 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 --- 85ec3e7778c09f5d4f52a29f57c5ecc64070ffd1 diff --git a/lib/error.tcl b/lib/error.tcl index 45800d5493..08a24622c7 100644 --- a/lib/error.tcl +++ b/lib/error.tcl @@ -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} {