threads / patch / 21856

patchgit-gui: suppress the X error on exit

Subject: [PATCH] git-gui: suppress the X error on exit

## tl;dr

2 messages between Dec 4, 2009 and Dec 4, 2009. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Jindrich Makovicka· Dec 4, 2009, 09:28 UTC · lore
Hi,

Due to a bug in Tk, git-gui almost always (unless git-gui is closed right after starting) produces an X window error message on exit, something like

X Error of failed request:  RenderBadPicture (invalid Picture parameter)
  Major opcode of failed request:  150 (RENDER)
  Minor opcode of failed request:  7 (RenderFreePicture)
  Picture id in failed request: 0x3a000dc
  Serial number of failed request:  1965
  Current serial number in output stream:  1980
Respective Tk bug report is here:
http://sourceforge.net/tracker/?func=detail&atid=112997&aid=1821174&group_id=12997

This bug is triggered only when the send command is blocked via rename send {} . The following patch re-enables send just before quiting git-gui to suppress the error.

--- git-gui~ 2009-11-17 23:28:30.000000000 +0100 +++ git-gui 2009-12-03 23:32:50.848588924 +0100

Show changes to diff +4 −0
@@ -2023,6 +2023,10 @@
 	}
 
 	set ret_code $rc
+
+	# briefly re-enable send to suppress the RenderBadPicture error
+	tk appname [appname]
+
 	destroy .
 }
 
Shawn O. Pearce· Dec 4, 2009, 15:57 UTC · re: Jindrich Makovicka · lore

Re: [PATCH] git-gui: suppress the X error on exit

Jindrich Makovicka <makovick@gmail.com> wrote:
> Due to a bug in Tk, git-gui almost always (unless git-gui is closed
> right after starting) produces an X window error message on exit,
> something like

Thanks. I've wrapped it up into the following commit. Can I get a Signed-off-by line from you?

--8<-- [PATCH] git-gui: suppress RenderBadPicture X error caused by Tk bug

Due to a bug in Tk, git-gui almost always (unless git-gui is closed right after starting) produces an X window error message on exit, something like:

X Error of failed request:  RenderBadPicture (invalid Picture parameter)
  Major opcode of failed request:  150 (RENDER)
  Minor opcode of failed request:  7 (RenderFreePicture)
  Picture id in failed request: 0x3a000dc
  Serial number of failed request:  1965
  Current serial number in output stream:  1980
Respective Tk bug report is here:
http://sourceforge.net/tracker/?func=detail&atid=112997&aid=1821174&group_id=12997

This bug is triggered only when the send command is blocked via rename send {} . The following patch re-enables send just before quiting git-gui to suppress the error.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 git-gui.sh |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
Show changes to git-gui.sh +5 −0
diff --git a/git-gui.sh b/git-gui.sh
index 037a1f2..718277a 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -2052,6 +2052,11 @@ proc do_quit {{rc {1}}} {
 	}
 
 	set ret_code $rc
+
+	# Briefly enable send again, working around Tk bug
+	# http://sourceforge.net/tracker/?func=detail&atid=112997&aid=1821174&group_id=12997
+	tk appname [appname]
+
 	destroy .
 }
 
-- 
1.6.6.rc0.324.gb5bf2

-- 
Shawn.

← back to recent threads