]> source.dussan.org Git - tigervnc.git/commitdiff
Fixes yet another case where the viewport background wasn't painted black when the...
authorBrian Hinz <bphinz@users.sourceforge.net>
Thu, 21 Feb 2013 03:11:14 +0000 (03:11 +0000)
committerBrian Hinz <bphinz@users.sourceforge.net>
Thu, 21 Feb 2013 03:11:14 +0000 (03:11 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5049 3789f03b-4d11-0410-bbf8-ca57d06f2519

java/com/tigervnc/vncviewer/Viewport.java

index e8793a1bc9f0d890ff3a781676419cf0dff8b284..31acc0e1a893cb3c67cd034ab906ee08a67f0f9c 100644 (file)
@@ -68,23 +68,23 @@ public class Viewport extends JFrame
             scaleString.equalsIgnoreCase("FixedRatio")) {
           if ((sp.getSize().width != cc.desktop.scaledWidth) ||
               (sp.getSize().height != cc.desktop.scaledHeight)) {
-            int policy = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER;
-            sp.setHorizontalScrollBarPolicy(policy);
             cc.desktop.setScaledSize();
-            sp.setSize(new Dimension(cc.desktop.scaledWidth,
-                                     cc.desktop.scaledHeight));
+            sp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+            sp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
             sp.validate();
             if (getExtendedState() != JFrame.MAXIMIZED_BOTH &&
-                scaleString.equalsIgnoreCase("FixedRatio") &&
                 !cc.fullScreen) {
+              sp.setSize(new Dimension(cc.desktop.scaledWidth,
+                                       cc.desktop.scaledHeight));
               int w = cc.desktop.scaledWidth + getInsets().left + getInsets().right;
               int h = cc.desktop.scaledHeight + getInsets().top + getInsets().bottom;
-              setSize(w, h);
+              if (scaleString.equalsIgnoreCase("FixedRatio"))
+                setSize(w, h);
             }
           }
         } else {
-          int policy = ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
-          sp.setHorizontalScrollBarPolicy(policy);
+          sp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+          sp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
           sp.validate();
         }
         if (cc.desktop.cursor != null) {