* Re: [RFC/PATCH] Force using Tcl/Tk 8.4 on Mac OS X
2010-09-07 19:56 ` Stefan Haller
@ 2010-09-11 7:12 ` Stefan Haller
2010-09-11 7:31 ` Stefan Haller
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Stefan Haller @ 2010-09-11 7:12 UTC (permalink / raw)
To: Pat Thoyts, Daniel A. Steffen; +Cc: git, Daniel A Steffen
Stefan Haller <lists@haller-berlin.de> wrote:
> Pat Thoyts <patthoyts@users.sourceforge.net> wrote:
>
> > This removes the Cmd-J accelerator from the "Revert Changes" menu
> > item. I assume that just changing the menu command to
> > {after idle [list do_revert_selection]}
> > doesn't work either?
>
> No, but "after 100" does for me; "after 10" does not, and "after 50"
> does some of the time. I'm not sure if this would be suitable as a
> workaround then.
We seem to be stuck with this right now. What can I do to move this
forward? I have little experience with Tcl/Tk, so I'm probably unable
to solve this in a satifactory way myself; but I'd like to do everything
I can to make progress here.
Do people think that the "after 100" hack would be acceptable, if it's
conditional for {[is_MacOSX] && $::have_tk85}? Would it help if I try
to come up with a patch for that?
-Stefan
--
Stefan Haller
Ableton
http://www.ableton.com/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [RFC/PATCH] Force using Tcl/Tk 8.4 on Mac OS X
2010-09-07 19:56 ` Stefan Haller
2010-09-11 7:12 ` Stefan Haller
@ 2010-09-11 7:31 ` Stefan Haller
2010-09-21 8:26 ` [PATCH] git-gui: Work around freeze problem with dialogs in " Stefan Haller
2010-09-22 17:46 ` Stefan Haller
3 siblings, 0 replies; 11+ messages in thread
From: Stefan Haller @ 2010-09-11 7:31 UTC (permalink / raw)
To: Pat Thoyts, Daniel A. Steffen; +Cc: git, Daniel A Steffen
Stefan Haller <lists@haller-berlin.de> wrote:
> Pat Thoyts <patthoyts@users.sourceforge.net> wrote:
>
> > This removes the Cmd-J accelerator from the "Revert Changes" menu
> > item. I assume that just changing the menu command to
> > {after idle [list do_revert_selection]}
> > doesn't work either?
>
> No, but "after 100" does for me; "after 10" does not, and "after 50"
> does some of the time. I'm not sure if this would be suitable as a
> workaround then.
We seem to be stuck with this right now. What can I do to move this
forward? I have little experience with Tcl/Tk, so I'm probably unable
to solve this in a satifactory way myself; but I'd like to do everything
I can to help make progress here.
Do people think that the "after 100" hack would be acceptable, if it's
conditional for {[is_MacOSX] && $::have_tk85}? Would it help if I try
to come up with a patch for that?
-Stefan
(Sorry for the duplicate mail; I used the wrong return address the first
time, so it didn't got to the list.)
--
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] git-gui: Work around freeze problem with dialogs in Mac OS X
2010-09-07 19:56 ` Stefan Haller
2010-09-11 7:12 ` Stefan Haller
2010-09-11 7:31 ` Stefan Haller
@ 2010-09-21 8:26 ` Stefan Haller
2010-09-22 17:46 ` Stefan Haller
3 siblings, 0 replies; 11+ messages in thread
From: Stefan Haller @ 2010-09-21 8:26 UTC (permalink / raw)
To: Pat Thoyts, Daniel A. Steffen; +Cc: git, Daniel A Steffen
Tk 8.5 on Mac OS X has a bug whereby a dialog opened from a key
binding will hang; see issue 3044863 in the Tk issue tracker.
<http://sourceforge.net/tracker/?func=detail&aid=3044863&group_id=12997&atid=112997>
To work around this, we perform commands that open a dialog after
a brief delay; 150 ms seems to be a good compromise between short
enough as to be not annoying, and long enough to reliably work
around the issue.
Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
---
git-gui.sh | 39 +++++++++++++++++++++++++++------------
1 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/git-gui.sh b/git-gui.sh
index 4617f29..394c2a0 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -3560,6 +3560,21 @@ if {[info exists repo_config(gui.wmstate)]} {
catch {wm state . $repo_config(gui.wmstate)}
}
+proc mac_freeze_workaround {cmd} {
+ if {[is_MacOSX] && $::have_tk85} {
+ # Tk 8.5 on Mac OS X has a bug whereby a dialog opened from a key
+ # binding will hang; see issue 3044863 in the Tk issue tracker.
+ # <http://sourceforge.net/tracker/?func=detail&aid=3044863&group_id=12997&atid=112997>
+ #
+ # To work around this, we perform commands that open a dialog after a brief
+ # delay; 150 ms seems to be a good compromise between short enough as to be
+ # not annoying, and long enough to reliably work around the issue.
+ after 150 $cmd
+ } else {
+ $cmd
+ }
+}
+
# -- Key Bindings
#
bind $ui_comm <$M1B-Key-Return> {do_commit;break}
@@ -3567,8 +3582,8 @@ bind $ui_comm <$M1B-Key-t> {do_add_selection;break}
bind $ui_comm <$M1B-Key-T> {do_add_selection;break}
bind $ui_comm <$M1B-Key-u> {do_unstage_selection;break}
bind $ui_comm <$M1B-Key-U> {do_unstage_selection;break}
-bind $ui_comm <$M1B-Key-j> {do_revert_selection;break}
-bind $ui_comm <$M1B-Key-J> {do_revert_selection;break}
+bind $ui_comm <$M1B-Key-j> {mac_freeze_workaround do_revert_selection;break}
+bind $ui_comm <$M1B-Key-J> {mac_freeze_workaround do_revert_selection;break}
bind $ui_comm <$M1B-Key-i> {do_add_all;break}
bind $ui_comm <$M1B-Key-I> {do_add_all;break}
bind $ui_comm <$M1B-Key-x> {tk_textCut %W;break}
@@ -3606,16 +3621,16 @@ bind $ui_diff <Control-Key-f> {catch {%W yview scroll 1 pages};break}
bind $ui_diff <Button-1> {focus %W}
if {[is_enabled branch]} {
- bind . <$M1B-Key-n> branch_create::dialog
- bind . <$M1B-Key-N> branch_create::dialog
- bind . <$M1B-Key-o> branch_checkout::dialog
- bind . <$M1B-Key-O> branch_checkout::dialog
- bind . <$M1B-Key-m> merge::dialog
- bind . <$M1B-Key-M> merge::dialog
+ bind . <$M1B-Key-n> {mac_freeze_workaround branch_create::dialog}
+ bind . <$M1B-Key-N> {mac_freeze_workaround branch_create::dialog}
+ bind . <$M1B-Key-o> {mac_freeze_workaround branch_checkout::dialog}
+ bind . <$M1B-Key-O> {mac_freeze_workaround branch_checkout::dialog}
+ bind . <$M1B-Key-m> {mac_freeze_workaround merge::dialog}
+ bind . <$M1B-Key-M> {mac_freeze_workaround merge::dialog}
}
if {[is_enabled transport]} {
- bind . <$M1B-Key-p> do_push_anywhere
- bind . <$M1B-Key-P> do_push_anywhere
+ bind . <$M1B-Key-p> {mac_freeze_workaround do_push_anywhere}
+ bind . <$M1B-Key-P> {mac_freeze_workaround do_push_anywhere}
}
bind . <Key-F5> ui_do_rescan
@@ -3625,8 +3640,8 @@ bind . <$M1B-Key-s> do_signoff
bind . <$M1B-Key-S> do_signoff
bind . <$M1B-Key-t> do_add_selection
bind . <$M1B-Key-T> do_add_selection
-bind . <$M1B-Key-j> do_revert_selection
-bind . <$M1B-Key-J> do_revert_selection
+bind . <$M1B-Key-j> {mac_freeze_workaround do_revert_selection}
+bind . <$M1B-Key-J> {mac_freeze_workaround do_revert_selection}
bind . <$M1B-Key-i> do_add_all
bind . <$M1B-Key-I> do_add_all
bind . <$M1B-Key-minus> {show_less_context;break}
--
1.7.3.4.g200b9
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH] git-gui: Work around freeze problem with dialogs in Mac OS X
2010-09-07 19:56 ` Stefan Haller
` (2 preceding siblings ...)
2010-09-21 8:26 ` [PATCH] git-gui: Work around freeze problem with dialogs in " Stefan Haller
@ 2010-09-22 17:46 ` Stefan Haller
2010-09-22 19:01 ` Junio C Hamano
3 siblings, 1 reply; 11+ messages in thread
From: Stefan Haller @ 2010-09-22 17:46 UTC (permalink / raw)
To: git
Tk 8.5 on Mac OS X has a bug whereby a dialog opened from a key
binding will hang; see issue 3044863 in the Tk issue tracker.
<http://sourceforge.net/tracker/?func=detail&aid=3044863&group_id=12997&atid=112997>
To work around this, we perform commands that open a dialog after
a brief delay; 150 ms seems to be a good compromise between short
enough as to be not annoying, and long enough to reliably work
around the issue.
Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
---
I already sent this two days ago, but it didn't seem to appear on the
list for some reason, so I'm resending it. Apologies if you see this
twice.
git-gui.sh | 39 +++++++++++++++++++++++++++------------
1 files changed, 27 insertions(+), 12 deletions(-)
diff --git a/git-gui.sh b/git-gui.sh
index 4617f29..394c2a0 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -3560,6 +3560,21 @@ if {[info exists repo_config(gui.wmstate)]} {
catch {wm state . $repo_config(gui.wmstate)}
}
+proc mac_freeze_workaround {cmd} {
+ if {[is_MacOSX] && $::have_tk85} {
+ # Tk 8.5 on Mac OS X has a bug whereby a dialog opened from a key
+ # binding will hang; see issue 3044863 in the Tk issue tracker.
+ # <http://sourceforge.net/tracker/?func=detail&aid=3044863&group_id=12997&atid=112997>
+ #
+ # To work around this, we perform commands that open a dialog after a brief
+ # delay; 150 ms seems to be a good compromise between short enough as to be
+ # not annoying, and long enough to reliably work around the issue.
+ after 150 $cmd
+ } else {
+ $cmd
+ }
+}
+
# -- Key Bindings
#
bind $ui_comm <$M1B-Key-Return> {do_commit;break}
@@ -3567,8 +3582,8 @@ bind $ui_comm <$M1B-Key-t> {do_add_selection;break}
bind $ui_comm <$M1B-Key-T> {do_add_selection;break}
bind $ui_comm <$M1B-Key-u> {do_unstage_selection;break}
bind $ui_comm <$M1B-Key-U> {do_unstage_selection;break}
-bind $ui_comm <$M1B-Key-j> {do_revert_selection;break}
-bind $ui_comm <$M1B-Key-J> {do_revert_selection;break}
+bind $ui_comm <$M1B-Key-j> {mac_freeze_workaround do_revert_selection;break}
+bind $ui_comm <$M1B-Key-J> {mac_freeze_workaround do_revert_selection;break}
bind $ui_comm <$M1B-Key-i> {do_add_all;break}
bind $ui_comm <$M1B-Key-I> {do_add_all;break}
bind $ui_comm <$M1B-Key-x> {tk_textCut %W;break}
@@ -3606,16 +3621,16 @@ bind $ui_diff <Control-Key-f> {catch {%W yview scroll 1 pages};break}
bind $ui_diff <Button-1> {focus %W}
if {[is_enabled branch]} {
- bind . <$M1B-Key-n> branch_create::dialog
- bind . <$M1B-Key-N> branch_create::dialog
- bind . <$M1B-Key-o> branch_checkout::dialog
- bind . <$M1B-Key-O> branch_checkout::dialog
- bind . <$M1B-Key-m> merge::dialog
- bind . <$M1B-Key-M> merge::dialog
+ bind . <$M1B-Key-n> {mac_freeze_workaround branch_create::dialog}
+ bind . <$M1B-Key-N> {mac_freeze_workaround branch_create::dialog}
+ bind . <$M1B-Key-o> {mac_freeze_workaround branch_checkout::dialog}
+ bind . <$M1B-Key-O> {mac_freeze_workaround branch_checkout::dialog}
+ bind . <$M1B-Key-m> {mac_freeze_workaround merge::dialog}
+ bind . <$M1B-Key-M> {mac_freeze_workaround merge::dialog}
}
if {[is_enabled transport]} {
- bind . <$M1B-Key-p> do_push_anywhere
- bind . <$M1B-Key-P> do_push_anywhere
+ bind . <$M1B-Key-p> {mac_freeze_workaround do_push_anywhere}
+ bind . <$M1B-Key-P> {mac_freeze_workaround do_push_anywhere}
}
bind . <Key-F5> ui_do_rescan
@@ -3625,8 +3640,8 @@ bind . <$M1B-Key-s> do_signoff
bind . <$M1B-Key-S> do_signoff
bind . <$M1B-Key-t> do_add_selection
bind . <$M1B-Key-T> do_add_selection
-bind . <$M1B-Key-j> do_revert_selection
-bind . <$M1B-Key-J> do_revert_selection
+bind . <$M1B-Key-j> {mac_freeze_workaround do_revert_selection}
+bind . <$M1B-Key-J> {mac_freeze_workaround do_revert_selection}
bind . <$M1B-Key-i> do_add_all
bind . <$M1B-Key-I> do_add_all
bind . <$M1B-Key-minus> {show_less_context;break}
--
1.7.3.4.g200b9
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] git-gui: Work around freeze problem with dialogs in Mac OS X
2010-09-22 17:46 ` Stefan Haller
@ 2010-09-22 19:01 ` Junio C Hamano
2010-09-23 7:39 ` Stefan Haller
0 siblings, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2010-09-22 19:01 UTC (permalink / raw)
To: Stefan Haller; +Cc: git
lists@haller-berlin.de (Stefan Haller) writes:
> Tk 8.5 on Mac OS X has a bug whereby a dialog opened from a key
> binding will hang; see issue 3044863 in the Tk issue tracker.
> <http://sourceforge.net/tracker/?func=detail&aid=3044863&group_id=12997&atid=112997>
>
> To work around this, we perform commands that open a dialog after
> a brief delay; 150 ms seems to be a good compromise between short
> enough as to be not annoying, and long enough to reliably work
> around the issue.
>
> Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
Is 150ms applicable no matter how fast or slow your Mac is, or is Mac so
monoculture that everybody's machine has more or less the same performance
characteristics? IOW does this need to be autoadjusted?
I see a lot of wrapping around foo::dialog; without knowing much about
Tcl, I wonder if it would be simpler, less error prone and more future
proof to add the wrapping logic around something commonly used from them,
e.g. class::make_dialog.
> ---
> I already sent this two days ago, but it didn't seem to appear on the
> list for some reason, so I'm resending it. Apologies if you see this
> twice.
>
> git-gui.sh | 39 +++++++++++++++++++++++++++------------
> 1 files changed, 27 insertions(+), 12 deletions(-)
>
> diff --git a/git-gui.sh b/git-gui.sh
> index 4617f29..394c2a0 100755
> --- a/git-gui.sh
> +++ b/git-gui.sh
> @@ -3560,6 +3560,21 @@ if {[info exists repo_config(gui.wmstate)]} {
> catch {wm state . $repo_config(gui.wmstate)}
> }
>
> +proc mac_freeze_workaround {cmd} {
> + if {[is_MacOSX] && $::have_tk85} {
> + # Tk 8.5 on Mac OS X has a bug whereby a dialog opened from a key
> + # binding will hang; see issue 3044863 in the Tk issue tracker.
> + # <http://sourceforge.net/tracker/?func=detail&aid=3044863&group_id=12997&atid=112997>
> + #
> + # To work around this, we perform commands that open a dialog after a brief
> + # delay; 150 ms seems to be a good compromise between short enough as to be
> + # not annoying, and long enough to reliably work around the issue.
> + after 150 $cmd
> + } else {
> + $cmd
> + }
> +}
> +
> # -- Key Bindings
> #
> bind $ui_comm <$M1B-Key-Return> {do_commit;break}
> @@ -3567,8 +3582,8 @@ bind $ui_comm <$M1B-Key-t> {do_add_selection;break}
> bind $ui_comm <$M1B-Key-T> {do_add_selection;break}
> bind $ui_comm <$M1B-Key-u> {do_unstage_selection;break}
> bind $ui_comm <$M1B-Key-U> {do_unstage_selection;break}
> -bind $ui_comm <$M1B-Key-j> {do_revert_selection;break}
> -bind $ui_comm <$M1B-Key-J> {do_revert_selection;break}
> +bind $ui_comm <$M1B-Key-j> {mac_freeze_workaround do_revert_selection;break}
> +bind $ui_comm <$M1B-Key-J> {mac_freeze_workaround do_revert_selection;break}
> bind $ui_comm <$M1B-Key-i> {do_add_all;break}
> bind $ui_comm <$M1B-Key-I> {do_add_all;break}
> bind $ui_comm <$M1B-Key-x> {tk_textCut %W;break}
> @@ -3606,16 +3621,16 @@ bind $ui_diff <Control-Key-f> {catch {%W yview scroll 1 pages};break}
> bind $ui_diff <Button-1> {focus %W}
>
> if {[is_enabled branch]} {
> - bind . <$M1B-Key-n> branch_create::dialog
> - bind . <$M1B-Key-N> branch_create::dialog
> - bind . <$M1B-Key-o> branch_checkout::dialog
> - bind . <$M1B-Key-O> branch_checkout::dialog
> - bind . <$M1B-Key-m> merge::dialog
> - bind . <$M1B-Key-M> merge::dialog
> + bind . <$M1B-Key-n> {mac_freeze_workaround branch_create::dialog}
> + bind . <$M1B-Key-N> {mac_freeze_workaround branch_create::dialog}
> + bind . <$M1B-Key-o> {mac_freeze_workaround branch_checkout::dialog}
> + bind . <$M1B-Key-O> {mac_freeze_workaround branch_checkout::dialog}
> + bind . <$M1B-Key-m> {mac_freeze_workaround merge::dialog}
> + bind . <$M1B-Key-M> {mac_freeze_workaround merge::dialog}
> }
> if {[is_enabled transport]} {
> - bind . <$M1B-Key-p> do_push_anywhere
> - bind . <$M1B-Key-P> do_push_anywhere
> + bind . <$M1B-Key-p> {mac_freeze_workaround do_push_anywhere}
> + bind . <$M1B-Key-P> {mac_freeze_workaround do_push_anywhere}
> }
>
> bind . <Key-F5> ui_do_rescan
> @@ -3625,8 +3640,8 @@ bind . <$M1B-Key-s> do_signoff
> bind . <$M1B-Key-S> do_signoff
> bind . <$M1B-Key-t> do_add_selection
> bind . <$M1B-Key-T> do_add_selection
> -bind . <$M1B-Key-j> do_revert_selection
> -bind . <$M1B-Key-J> do_revert_selection
> +bind . <$M1B-Key-j> {mac_freeze_workaround do_revert_selection}
> +bind . <$M1B-Key-J> {mac_freeze_workaround do_revert_selection}
> bind . <$M1B-Key-i> do_add_all
> bind . <$M1B-Key-I> do_add_all
> bind . <$M1B-Key-minus> {show_less_context;break}
> --
> 1.7.3.4.g200b9
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] git-gui: Work around freeze problem with dialogs in Mac OS X
2010-09-22 19:01 ` Junio C Hamano
@ 2010-09-23 7:39 ` Stefan Haller
0 siblings, 0 replies; 11+ messages in thread
From: Stefan Haller @ 2010-09-23 7:39 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Daniel A Steffen, Daniel A. Steffen
Junio C Hamano <gitster@pobox.com> wrote:
> lists@haller-berlin.de (Stefan Haller) writes:
>
> > Tk 8.5 on Mac OS X has a bug whereby a dialog opened from a key
> > binding will hang; see issue 3044863 in the Tk issue tracker.
> > <http://sourceforge.net/tracker/?func=detail&aid=3044863&group_id=12997&atid=112997>
> >
> > To work around this, we perform commands that open a dialog after
> > a brief delay; 150 ms seems to be a good compromise between short
> > enough as to be not annoying, and long enough to reliably work
> > around the issue.
> >
> > Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
>
> Is 150ms applicable no matter how fast or slow your Mac is, or is Mac so
> monoculture that everybody's machine has more or less the same performance
> characteristics? IOW does this need to be autoadjusted?
To be honest, I don't know. I was hoping that Daniel could shed some
light on whether this is dependent on the machine's performance, or why
the delay is needed at all (i.e. why a simple "after idle" won't do, as
one would have expected).
> I see a lot of wrapping around foo::dialog; without knowing much about
> Tcl, I wonder if it would be simpler, less error prone and more future
> proof to add the wrapping logic around something commonly used from them,
> e.g. class::make_dialog.
I need to wrap the top-level entry points of the command handlers,
because we want the delay only when the command is invoked from a key
binding, not when a menu item is selected with the mouse, or a button is
pushed. Inside the functions, at the place where the dialog is created,
I can't tell from where we were called.
--
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/
^ permalink raw reply [flat|nested] 11+ messages in thread