f30e46e4d2ee9f48ef87cc87b95159c37dffeb6a
galt
  Wed Feb 17 12:59:44 2016 -0800
Fixes #16818. Gets better cross-all-windows error handling working for bigDataUrl/network tracks.

Squashed commit of the following:

commit cdf9db633c9018538aabf9c8346eabee63b5a3cf
Author: Galt Barber <galt@soe.ucsc.edu>
Date:   Wed Feb 17 12:55:47 2016 -0800

Fixed width in bigWarn.c and background in multiWig.c

commit 3620dcd0912660fabbd993df4af119cc03676545
Author: Galt Barber <galt@soe.ucsc.edu>
Date:   Tue Feb 16 11:53:32 2016 -0800

Initial checking for multi-region all-windows warn. This is an attempt to handle timeout high-level errors better, when a track is taking too long to finish loading; and to handle the network errors across all of the windows together, i.e. using the entire screen width to display the errors, only diplaying the first error, and only drawing for the first window.

diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index 310803b..0a91460 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -55,30 +55,31 @@
 #include "mafTrack.h"
 #include "hgConfig.h"
 #include "encode.h"
 #include "agpFrag.h"
 #include "imageV2.h"
 #include "suggest.h"
 #include "search.h"
 #include "errCatch.h"
 #include "iupac.h"
 #include "botDelay.h"
 #include "chromInfo.h"
 #include "extTools.h"
 #include "basicBed.h"
 #include "customFactory.h"
 #include "genbank.h"
+#include "bigWarn.h"
 
 /* Other than submit and Submit all these vars should start with hgt.
  * to avoid weeding things out of other program's namespaces.
  * Because the browser is a central program, most of its cart
  * variables are not hgt. qualified.  It's a good idea if other
  * program's unique variables be qualified with a prefix though. */
 char *excludeVars[] = { "submit", "Submit", "dirty", "hgt.reset",
             "hgt.in1", "hgt.in2", "hgt.in3", "hgt.inBase",
             "hgt.out1", "hgt.out2", "hgt.out3", "hgt.out4",
             "hgt.left1", "hgt.left2", "hgt.left3",
             "hgt.right1", "hgt.right2", "hgt.right3",
             "hgt.dinkLL", "hgt.dinkLR", "hgt.dinkRL", "hgt.dinkRR",
             "hgt.tui", "hgt.hideAll", "hgt.visAllFromCt",
 	    "hgt.psOutput", "hideControls", "hgt.toggleRevCmplDisp",
 	    "hgt.collapseGroups", "hgt.expandGroups", "hgt.suggest",
@@ -7319,30 +7320,55 @@
     }
 }
 
 boolean windowsHaveMultipleChroms()
 /* Are there multiple different chromosomes in the windows list? */
 {
 struct window *window;
 for (window=windows->next; window; window=window->next)
     {
     if (!sameString(window->chromName,windows->chromName))
 	return TRUE;
     }
 return FALSE;
 }
 
+static void setSharedErrorsAcrossWindows(struct track *track)
+/* Look for network errors across all windows
+ * if found, set all windows to same errMsg and set bigWarn track handlers. */
+{
+char *sharedErrMsg = NULL;
+struct track *tg;
+for (tg=track; tg; tg=tg->nextWindow)
+    {
+    if (!sharedErrMsg && tg->networkErrMsg)
+	{
+	sharedErrMsg = tg->networkErrMsg;
+	break;
+	}
+    }
+if (sharedErrMsg)
+    {
+    for (tg=track; tg; tg=tg->nextWindow)
+	{
+	tg->networkErrMsg = sharedErrMsg;
+	tg->drawItems = bigDrawWarning;
+	tg->totalHeight = bigWarnTotalHeight;
+	}
+    }
+}
+
 void doTrackForm(char *psOutput, struct tempName *ideoTn)
 /* Make the tracks display form with the zoom/scroll buttons and the active
  * image.  If the ideoTn parameter is not NULL, it is filled in if the
  * ideogram is created.  */
 {
 struct group *group;
 struct track *track;
 char *freezeName = NULL;
 boolean hideAll = cgiVarExists("hgt.hideAll");
 boolean defaultTracks = cgiVarExists("hgt.reset");
 boolean showedRuler = FALSE;
 boolean showTrackControls = cartUsualBoolean(cart, "trackControlsOnMain", TRUE);
 long thisTime = 0, lastTime = 0;
 
 basesPerPixel = ((float)virtWinBaseCount) / ((float)fullInsideWidth);
@@ -7641,32 +7667,48 @@
     if (ptMax > 0)
 	{
 	// TODO GALT parallel actually not sure if anything to worry about here
 	/* wait for remote parallel load to finish */
 	remoteParallelLoadWait(atoi(cfgOptionDefault("parallelFetch.timeout", "90")));  // wait up to default 90 seconds.
 	if (measureTiming)
 	    measureTime("Waiting for parallel (%d threads for %d tracks) remote data fetch", ptMax, pfdListCount);
 	}
 
     }
 trackLoadingInProgress = FALSE;
 
 setGlobalsFromWindow(windows); // first window // restore globals
 trackList = windows->trackList;  // restore track list
 
+
+// Look for network errors across all windows
+// if found, set all windows to same errMsg and set bigWarn track handlers.
+for (track = trackList; track != NULL; track = track->next)
+    {
+    setSharedErrorsAcrossWindows(track);
+    struct track *sub;
+    for (sub=track->subtracks; sub; sub=sub->next)
+	{
+	setSharedErrorsAcrossWindows(sub);
+	}
+    }
+
+
+
 //////////////  END OF MULTI-WINDOW LOOP
 
+
 printTrackInitJavascript(trackList);
 
 /* Generate two lists of hidden variables for track group visibility.  Kludgy,
    but required b/c we have two different navigation forms on this page, but
    we want open/close changes in the bottom form to be submitted even if the user
    submits via the top form. */
 struct dyString *trackGroupsHidden1 = newDyString(1000);
 struct dyString *trackGroupsHidden2 = newDyString(1000);
 for (group = groupList; group != NULL; group = group->next)
     {
     if (group->trackList != NULL)
         {
         int looper;
         for (looper=1;looper<=2;looper++)
             {