summaryrefslogtreecommitdiff
path: root/graphics/tclblt/patches/03-fedora-patch-2.patch
blob: cc79cb51750387ac7fa15e129cf8642888cd98aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
   * Apply 3 changes based on revisions developed by the fedora linux team.
 --> + 03-fedora-patch-2.diff
     + 04-fedora-tk8.5.6.patch.diff
     + 05-tk8.5-zoomstack.diff
    * Those patches are required to solve segmentation faults that are observed
     when blt is used with tcltk 8.5. We have a substantial amount of
     experience using this patched version of blt in the Swarm
     Simulation System (www.swarm.org) and have observed no ill-effects.
Author: Paul E. Johnson (Debian Packaging) <pauljohn32@freefaculty.org>

--- a/generic/bltGrElem.c
+++ b/generic/bltGrElem.c
@@ -1664,6 +1664,7 @@
     ClosestSearch search;
     int i, x, y;
     int flags = TCL_LEAVE_ERR_MSG;
+    int found;
 
     if (graphPtr->flags & RESET_AXES) {
 	Blt_ResetAxes(graphPtr);
@@ -1708,12 +1709,21 @@
     search.dist = (double)(search.halo + 1);
 
     if (i < argc) {
+	Blt_ChainLink *linkPtr;
 
 	for ( /* empty */ ; i < argc; i++) {
 	    if (NameToElement(graphPtr, argv[i], &elemPtr) != TCL_OK) {
 		return TCL_ERROR;	/* Can't find named element */
 	    }
- 	    if (elemPtr->hidden) {
+	    found = FALSE;
+	    for (linkPtr = Blt_ChainFirstLink(graphPtr->elements.displayList);
+		 linkPtr == NULL; linkPtr = Blt_ChainNextLink(linkPtr)) {
+		if (elemPtr == Blt_ChainGetValue(linkPtr)) {
+		    found = TRUE;
+		    break;
+		}
+	    }
+	    if ((!found) || (elemPtr->hidden)) {
  		Tcl_AppendResult(interp, "element \"", argv[i],
  			"\" is hidden", (char *)NULL);
   		return TCL_ERROR;	/* Element isn't visible */