Pivot
  1. Pivot
  2. PIVOT-754

Pivot displays ugly gray box sometimes before it loads the applet

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0, 2.0.1, 2.0.2
    • Fix Version/s: 2.5
    • Component/s: wtk
    • Labels:
      None
    • Environment:
      Observed both on Linux and Windows Vista, Firefox 3.x and Firefox 4.0.1
      Java 6 update 25.

      Description

      When the applet starts, a progress bar is displayed. When the applet finishes downloading, the progress bar disappears, leaving a gray box until the pivot toolkit loads the application. Even for the simpliest application displaying an empty window, pivot requires about 0.3 s to start (on Core2Duo 2.2 GHz), so the gray box effect can be easily seen. The gray box effect does not happen always, but in about half of the cases.

      Below I submit patch we made to the BrowserApplicationContext.java file. Seems like setting the applet's background to white and delaying the add(displayHost) call as late as possible does the trick:

      [code]
      51a52
      > private boolean displayHostInstalled = false;
      151c152,154
      < add(displayHost);

      >
      > // Don't add it now, add it later, to avoid ugly gray box:
      > //add(displayHost);
      160c163,164
      < setBackground(null);

      > // Huh? WTF?
      > // setBackground(null);
      191a196
      > installDisplayHostIfNeeded();
      245a251,257
      > private void installDisplayHostIfNeeded() {
      > if (!displayHostInstalled)

      { > this.add(displayHost); > displayHostInstalled = true; > }

      > }
      >
      247a260
      > this.setBackground(Color.white);
      309a323
      > installDisplayHostIfNeeded();

      [/code]

      1. pivot-graybox.patch
        0.8 kB
        Piotr Kołaczkowski

        Issue Links

          Activity

          Piotr Kołaczkowski created issue -
          Piotr Kołaczkowski made changes -
          Field Original Value New Value
          Description When the applet starts, a progress bar is displayed. When the applet finishes downloading, the progress bar disappears, leaving a gray box until the pivot toolkit loads the application. Even for the simpliest application displaying an empty window, pivot requires about 0.3 s to start (on Core2Duo 2.2 GHz), so the gray box effect can be easily seen. The gray box effect does not happen always, but in about half of the cases.

          Below I submit patch we made to the BrowserApplicationContext.java file. Seems like setting the applet's background to white and delaying the add(displayHost) call as late as possible does the trick:

          {code}
          51a52
          > private boolean displayHostInstalled = false;
          151c152,154
          < add(displayHost);
          ---
          >
          > // Don't add it now, add it later, to avoid ugly gray box:
          > //add(displayHost);
          160c163,164
          < setBackground(null);
          ---
          > // Huh? WTF?
          > // setBackground(null);
          191a196
          > installDisplayHostIfNeeded();
          245a251,257
          > private void installDisplayHostIfNeeded() {
          > if (!displayHostInstalled) {
          > this.add(displayHost);
          > displayHostInstalled = true;
          > }
          > }
          >
          247a260
          > this.setBackground(Color.white);
          309a323
          > installDisplayHostIfNeeded();

          {code}
          When the applet starts, a progress bar is displayed. When the applet finishes downloading, the progress bar disappears, leaving a gray box until the pivot toolkit loads the application. Even for the simpliest application displaying an empty window, pivot requires about 0.3 s to start (on Core2Duo 2.2 GHz), so the gray box effect can be easily seen. The gray box effect does not happen always, but in about half of the cases.

          Below I submit patch we made to the BrowserApplicationContext.java file. Seems like setting the applet's background to white and delaying the add(displayHost) call as late as possible does the trick:

          [code]
          51a52
          > private boolean displayHostInstalled = false;
          151c152,154
          < add(displayHost);
          ---
          >
          > // Don't add it now, add it later, to avoid ugly gray box:
          > //add(displayHost);
          160c163,164
          < setBackground(null);
          ---
          > // Huh? WTF?
          > // setBackground(null);
          191a196
          > installDisplayHostIfNeeded();
          245a251,257
          > private void installDisplayHostIfNeeded() {
          > if (!displayHostInstalled) {
          > this.add(displayHost);
          > displayHostInstalled = true;
          > }
          > }
          >
          247a260
          > this.setBackground(Color.white);
          309a323
          > installDisplayHostIfNeeded();

          [/code]
          Piotr Kołaczkowski made changes -
          Attachment pivot-graybox.patch [ 12481804 ]
          Sandro Martini made changes -
          Fix Version/s 2.0.1 [ 12315951 ]
          Sandro Martini made changes -
          Comment [ Comments ?
          ]
          Sandro Martini made changes -
          Issue Type Bug [ 1 ] Improvement [ 4 ]
          Fix Version/s 2.0.2 [ 12317574 ]
          Fix Version/s 2.0.1 [ 12315951 ]
          Affects Version/s 2.0.1 [ 12315951 ]
          Sandro Martini made changes -
          Link This issue is related to PIVOT-755 [ PIVOT-755 ]
          Sandro Martini made changes -
          Assignee Sandro Martini [ smartini ]
          Sandro Martini made changes -
          Fix Version/s 2.0.3 [ 12321246 ]
          Fix Version/s 2.0.2 [ 12317574 ]
          Affects Version/s 2.0.2 [ 12317574 ]
          Sandro Martini made changes -
          Assignee Sandro Martini [ smartini ] Piotr Kołaczkowski [ pkolaczk ]
          Sandro Martini made changes -
          Fix Version/s 2.0.4 [ 12323384 ]
          Fix Version/s 2.0.3 [ 12321246 ]
          Sandro Martini made changes -
          Fix Version/s 2.5 [ 12314825 ]
          Fix Version/s 2.0.4 [ 12323384 ]
          Sandro Martini made changes -
          Assignee Piotr Kołaczkowski [ pkolaczk ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Piotr Kołaczkowski
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Development