git-gui: Fix 'Select All' action on Windows.
Sometimes the Select All action from our context menus doesn't work unless the text field its supposed to act on has focus. I'm not really sure why adding the sel tag requires having focus. It technically should not be required to update the sel tag membership, but perhaps there is a bug in Tcl/Tk 8.4.1 on Windows which is causing this odd behavior. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Jan 22, 2007 at 18:31 UTC
75e78c8a1bb273461c14a5b37f9b06215f502e67
1 file changed
+3
-3
git-gui.sh
+3
-3
@@ -2539,7 +2539,7 @@ proc console_init {w} {
2539
-command "tk_textCopy $w.m.t"
2540
$w.ctxm add command -label "Select All" \
2541
-font font_ui \
2542
- -command "$w.m.t tag add sel 0.0 end"
2542
+ -command "focus $w.m.t;$w.m.t tag add sel 0.0 end"
2543
$w.ctxm add command -label "Copy All" \
2544
-font font_ui \
2545
-command "
@@ -3913,7 +3913,7 @@ $ctxm add separator
3913
$ctxm add command \
3914
-label {Select All} \
3915
-font font_ui \
3916
- -command {$ui_comm tag add sel 0.0 end}
3916
+ -command {focus $ui_comm;$ui_comm tag add sel 0.0 end}
3917
$ctxm add command \
3918
-label {Copy All} \
3919
-font font_ui \
@@ -4059,7 +4059,7 @@ lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
4059
$ctxm add command \
4060
-label {Select All} \
4061
-font font_ui \
4062
- -command {$ui_diff tag add sel 0.0 end}
4062
+ -command {focus $ui_diff;$ui_diff tag add sel 0.0 end}
4063
lappend diff_actions [list $ctxm entryconf [$ctxm index last] -state]
4064
$ctxm add command \
4065
-label {Copy All} \