git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
* [PATCH] git-gui blame: prevent tool tips from sticking around after Command-Tab
@ 2020-10-13 13:26 Stefan Haller
  2020-10-13 15:17 ` Pratyush Yadav
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Haller @ 2020-10-13 13:26 UTC (permalink / raw)
  To: git; +Cc: me

On Mac, tooltips are not automatically removed when a window loses
focus. Furthermore, mouse-move events are only dispatched to the active
window, which means that if we Command-tab to another application while
a tool tip is showing, the tool tip will stay there forever (in front of
other applications). So we must hide it manually when we lose focus.

I'm doing this unconditionally here (i.e. without if {[is_MacOSX]}); it
shouldn't hurt on other platforms, even though they don't seem to have
this problem.

Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
---
 lib/blame.tcl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/blame.tcl b/lib/blame.tcl
index 62ec083..8441e10 100644
--- a/lib/blame.tcl
+++ b/lib/blame.tcl
@@ -328,6 +328,7 @@ constructor new {i_commit i_path i_jump} {
 		bind $i <Any-Motion>  [cb _show_tooltip $i @%x,%y]
 		bind $i <Any-Enter>   [cb _hide_tooltip]
 		bind $i <Any-Leave>   [cb _hide_tooltip]
+		bind $i <Deactivate>  [cb _hide_tooltip]
 		bind_button3 $i "
 			[cb _hide_tooltip]
 			set cursorX %x
-- 
2.29.0.rc1.12.gf22076828a


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] git-gui blame: prevent tool tips from sticking around after Command-Tab
  2020-10-13 13:26 [PATCH] git-gui blame: prevent tool tips from sticking around after Command-Tab Stefan Haller
@ 2020-10-13 15:17 ` Pratyush Yadav
  2020-10-17  9:37   ` Pratyush Yadav
  0 siblings, 1 reply; 3+ messages in thread
From: Pratyush Yadav @ 2020-10-13 15:17 UTC (permalink / raw)
  To: Stefan Haller; +Cc: git

Hi Stefan,

> Subject: [PATCH] git-gui blame: prevent tool tips from sticking around
Nitpick:                  ^ Add a ':' here.

On 13/10/20 03:26PM, Stefan Haller wrote:
> On Mac, tooltips are not automatically removed when a window loses
> focus. Furthermore, mouse-move events are only dispatched to the active
> window, which means that if we Command-tab to another application while
> a tool tip is showing, the tool tip will stay there forever (in front of
> other applications). So we must hide it manually when we lose focus.
> 
> I'm doing this unconditionally here (i.e. without if {[is_MacOSX]}); it

Nitpick: s/I'm doing this/Do this/.

> shouldn't hurt on other platforms, even though they don't seem to have
> this problem.

Yes, I don't have this problem on Linux. But this patch does not make 
any visible difference/regressions either.
 
> Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
> ---
>  lib/blame.tcl | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/blame.tcl b/lib/blame.tcl
> index 62ec083..8441e10 100644
> --- a/lib/blame.tcl
> +++ b/lib/blame.tcl
> @@ -328,6 +328,7 @@ constructor new {i_commit i_path i_jump} {
>  		bind $i <Any-Motion>  [cb _show_tooltip $i @%x,%y]
>  		bind $i <Any-Enter>   [cb _hide_tooltip]
>  		bind $i <Any-Leave>   [cb _hide_tooltip]
> +		bind $i <Deactivate>  [cb _hide_tooltip]
>  		bind_button3 $i "
>  			[cb _hide_tooltip]
>  			set cursorX %x

Will apply with the two nitpicks above fixed. No need to resend. Thanks.

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] git-gui blame: prevent tool tips from sticking around after Command-Tab
  2020-10-13 15:17 ` Pratyush Yadav
@ 2020-10-17  9:37   ` Pratyush Yadav
  0 siblings, 0 replies; 3+ messages in thread
From: Pratyush Yadav @ 2020-10-17  9:37 UTC (permalink / raw)
  To: Stefan Haller; +Cc: git

On 13/10/20 08:47PM, Pratyush Yadav wrote:
> Hi Stefan,
> 
> > Subject: [PATCH] git-gui blame: prevent tool tips from sticking around
> Nitpick:                  ^ Add a ':' here.
> 
> On 13/10/20 03:26PM, Stefan Haller wrote:
> > On Mac, tooltips are not automatically removed when a window loses
> > focus. Furthermore, mouse-move events are only dispatched to the active
> > window, which means that if we Command-tab to another application while
> > a tool tip is showing, the tool tip will stay there forever (in front of
> > other applications). So we must hide it manually when we lose focus.
> > 
> > I'm doing this unconditionally here (i.e. without if {[is_MacOSX]}); it
> 
> Nitpick: s/I'm doing this/Do this/.
> 
> > shouldn't hurt on other platforms, even though they don't seem to have
> > this problem.
> 
> Yes, I don't have this problem on Linux. But this patch does not make 
> any visible difference/regressions either.
>  
> > Signed-off-by: Stefan Haller <stefan@haller-berlin.de>
> > ---
> >  lib/blame.tcl | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/lib/blame.tcl b/lib/blame.tcl
> > index 62ec083..8441e10 100644
> > --- a/lib/blame.tcl
> > +++ b/lib/blame.tcl
> > @@ -328,6 +328,7 @@ constructor new {i_commit i_path i_jump} {
> >  		bind $i <Any-Motion>  [cb _show_tooltip $i @%x,%y]
> >  		bind $i <Any-Enter>   [cb _hide_tooltip]
> >  		bind $i <Any-Leave>   [cb _hide_tooltip]
> > +		bind $i <Deactivate>  [cb _hide_tooltip]
> >  		bind_button3 $i "
> >  			[cb _hide_tooltip]
> >  			set cursorX %x
> 
> Will apply with the two nitpicks above fixed. No need to resend. Thanks.

Applied to git-gui/master. Thanks.

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-17  9:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13 13:26 [PATCH] git-gui blame: prevent tool tips from sticking around after Command-Tab Stefan Haller
2020-10-13 15:17 ` Pratyush Yadav
2020-10-17  9:37   ` Pratyush Yadav

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git