git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] gitk: check main window visibility before waiting for it to show

From
Carlo Marcelo Arenas Belón <carenas@gmail.com>
Date
Aug 4, 2021, 01:09 UTC
Message-ID
<20210804010900.33133-4-carenas@gmail.com>
In-Reply-To
<20210804010900.33133-1-carenas@gmail.com>
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
-- 
2.33.0.rc0.433.g9a510e7e11
Previous: Carlo Marcelo Arenas BelónNext: Chris Torek
Message 3 of 6 in “gitk: macOS improvements”
  1. 0/3 gitk: macOS improvementsCarlo Marcelo Arenas Belón, Aug 4, 2021
  2. 1/3 gitk: skip calling osascript to set frontmost for tk >= 8.6Carlo Marcelo Arenas Belón, Aug 4, 2021
  3. 3/3 gitk: check main window visibility before waiting for it to showCarlo Marcelo Arenas Belón, Aug 4, 2021
  4. Chris TorekAug 4, 2021
  5. 2/3 gitk: avoid fatal error if `exec osascript` failsCarlo Marcelo Arenas Belón, Aug 4, 2021
  6. Carlo ArenasAug 4, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.