Commits

gubatron committed 97b762a

Fixes flickering issue on Overlay containers.

Comments (0)

Files changed (3)

gui/com/limegroup/gnutella/gui/search/OverlayAd.java

         loadOverlay();
     }
     
+    @Override
+    public boolean isOptimizedDrawingEnabled() {
+    	return false;
+    }
+    
     public void loadOverlay() {
     	_searchDone = false; //reloads intro promo
         introInfo = UISettings.INTRO_IMAGE_INFO;
      */
     private JPanel createImagePanel(String url,String torrentUrl) {
         JPanel panel = new JPanel(new BorderLayout());
+        
         try {
         	java.awt.MediaTracker mt = new java.awt.MediaTracker(panel);
         	mt.addImage(_image.getImage(), 0);

gui/com/limegroup/gnutella/gui/search/ResultPanel.java

     ResultPanel(JPanel overlay) {
         super(SEARCH_TABLE);
         setupFakeTable(overlay);
+
+        
         SEARCH_INFO = SearchInformation.createKeywordSearch("", null,
                                       MediaType.getAnyTypeMediaType());
         SPAM_FILTER=null;
     private void setupFakeTable(JPanel overlay) {
         MAIN_PANEL.removeAll();
         
-        JPanel background = new JPanel();
+        //Fixes flickering!
+        JPanel background = new JPanel() {
+			private static final long serialVersionUID = 8931395134232576566L;
+
+			public boolean isOptimizedDrawingEnabled() {
+                return false;
+              }
+        };
+        
         background.setLayout(new OverlayLayout(background));
+        
         JPanel overlayPanel = new BoxPanel(BoxPanel.Y_AXIS);
         overlayPanel.setOpaque(false);
         overlayPanel.add(Box.createVerticalStrut(20));
         overlayPanel.add(overlay);
+        
         overlayPanel.setMinimumSize(new Dimension(0, 0));
         JComponent table = getScrolledTablePane();
         table.setOpaque(false);

gui/com/limegroup/gnutella/gui/search/SearchResultDisplayer.java

 
 import java.awt.BorderLayout;
 import java.awt.CardLayout;
+import java.awt.Color;
 import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.IllegalComponentStateException;
         results.setPreferredSize(new Dimension(10000, 10000));
         results.setLayout(switcher);
         OVERLAY = new OverlayAd();
-		DUMMY = new ResultPanel(OVERLAY);
+        DUMMY = new ResultPanel(OVERLAY);
+		
 		mainScreen = new JPanel(new BorderLayout());
         mainScreen.add(DUMMY.getComponent(), BorderLayout.CENTER);
         results.add("dummy", mainScreen);
     }
 
 	/**
-	 * Accessor for the <tt>ResultPanel</tt> instance that shows no active
-	 * searches.
-	 *
-	 * @return the <tt>ResultPanel</tt> instance that shows no active
-	 * searches
-	 */
-    ResultPanel getDummyResultPanel(){
-		return DUMMY;
-    }
-
-	/**
 	 * Returns the <tt>JComponent</tt> instance containing all of the search
 	 * result ui components.
 	 *