diff options
author | fvogel <fvogelnew1@free.fr> | 2023-05-23 18:58:03 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2023-05-23 18:58:03 (GMT) |
commit | f5772f4bd64c0b956fbbb6673152b8dd7b4287f2 (patch) | |
tree | 5a31255c0087764852d0fc5d1801d8d6eaf6f808 /library/tk.tcl | |
parent | cfbfc56ab08376755eb01d9a30ab48af0fefe7cc (diff) | |
download | tk-f5772f4bd64c0b956fbbb6673152b8dd7b4287f2.zip tk-f5772f4bd64c0b956fbbb6673152b8dd7b4287f2.tar.gz tk-f5772f4bd64c0b956fbbb6673152b8dd7b4287f2.tar.bz2 |
Fix [7447ed20ec]: Color picker failure - tk::RestoreFocusGrab does not take into account the possibility of a failing grab.
Diffstat (limited to 'library/tk.tcl')
-rw-r--r-- | library/tk.tcl | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/library/tk.tcl b/library/tk.tcl index e00f073..98d643c 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -186,10 +186,13 @@ proc ::tk::RestoreFocusGrab {grab focus {destroy destroy}} { } } if {[winfo exists $oldGrab] && [winfo ismapped $oldGrab]} { + # The "grab" command will fail if another application + # already holds the grab on a window with the same name. + # So catch it. See [7447ed20ec] for an example. if {$oldStatus eq "global"} { - grab -global $oldGrab + catch {grab -global $oldGrab} } else { - grab $oldGrab + catch {grab $oldGrab} } } } |