git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Torek <chris.torek@gmail.com>
To: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>
Cc: Git List <git@vger.kernel.org>,
	paulus@samba.org, pietzsch@mycroft.speedport.ip,
	Eric Sunshine <sunshine@sunshineco.com>,
	tair.sabirgaliev@bee.kz, lists@haller-berlin.de
Subject: Re: [PATCH 3/3] gitk: check main window visibility before waiting for it to show
Date: Tue, 3 Aug 2021 23:27:14 -0700	[thread overview]
Message-ID: <CAPx1Gvdp85H_EY9qLY3jkxktXCDAwJyznMWfDDGHy56db7sc6Q@mail.gmail.com> (raw)
In-Reply-To: <20210804010900.33133-4-carenas@gmail.com>

On Tue, Aug 3, 2021 at 6:51 PM Carlo Marcelo Arenas Belón
<carenas@gmail.com> wrote:
>
> From: Tobias Pietzsch <pietzsch@mycroft.speedport.ip>
>
> If the main window is already visible when gitk waits for it to
> become visible, gitk hangs forever.
> This commit adds a check whether the window is already visible.
> See https://wiki.tcl-lang.org/page/tkwait+visibility
>
> Signed-off-by: Tobias Pietzsch <pietzsch@mycroft.speedport.ip>
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
> ---
>  gitk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gitk b/gitk
> index b62c12f..cc587b5 100755
> --- a/gitk
> +++ b/gitk
> @@ -12664,7 +12664,7 @@ catch {
>      wm iconphoto . -default gitlogo gitlogo32
>  }
>  # wait for the window to become visible
> -tkwait visibility .
> +if {![winfo viewable .]} {tkwait visibility .}
>  set_window_title
>  update
>  readrefs

I have no objection to this patch (and the other two look fine to me)
but I would like to say that this whole idea looks racy in general,
and that it would be better to fix this inside Tk itself: the internal
visibility-wait should be doing the visibility-check already. Given
that it's obviously *not*, this, as a workaround, seems OK.

Chris

  reply	other threads:[~2021-08-04  6:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04  1:08 [PATCH 0/3] gitk: macOS improvements Carlo Marcelo Arenas Belón
2021-08-04  1:08 ` [PATCH 1/3] gitk: skip calling osascript to set frontmost for tk >= 8.6 Carlo Marcelo Arenas Belón
2021-08-04  1:08 ` [PATCH 2/3] gitk: avoid fatal error if `exec osascript` fails Carlo Marcelo Arenas Belón
2021-08-04  1:09 ` [PATCH 3/3] gitk: check main window visibility before waiting for it to show Carlo Marcelo Arenas Belón
2021-08-04  6:27   ` Chris Torek [this message]
2021-08-04  2:37 ` [PATCH 0/3] gitk: macOS improvements Carlo Arenas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPx1Gvdp85H_EY9qLY3jkxktXCDAwJyznMWfDDGHy56db7sc6Q@mail.gmail.com \
    --to=chris.torek@gmail.com \
    --cc=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=lists@haller-berlin.de \
    --cc=paulus@samba.org \
    --cc=pietzsch@mycroft.speedport.ip \
    --cc=sunshine@sunshineco.com \
    --cc=tair.sabirgaliev@bee.kz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).