diff options
author | Brian Hinz <bphinz@users.sourceforge.net> | 2013-02-21 03:11:14 +0000 |
---|---|---|
committer | Brian Hinz <bphinz@users.sourceforge.net> | 2013-02-21 03:11:14 +0000 |
commit | 0bc5b5e42fbea7ed80f8492b11bd700ae55d6baf (patch) | |
tree | 8d3b4678bfe928be7f27a1ba31511b9a0476143f | |
parent | 571089bceac205c3d5056fcb3f51c2d4b2d0592e (diff) | |
download | tigervnc-0bc5b5e42fbea7ed80f8492b11bd700ae55d6baf.tar.gz tigervnc-0bc5b5e42fbea7ed80f8492b11bd700ae55d6baf.zip |
Fixes yet another case where the viewport background wasn't painted black when the desktop size was less than the viewport size. Also set both scrollbar policies just as a precaution.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5049 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | java/com/tigervnc/vncviewer/Viewport.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/java/com/tigervnc/vncviewer/Viewport.java b/java/com/tigervnc/vncviewer/Viewport.java index e8793a1b..31acc0e1 100644 --- a/java/com/tigervnc/vncviewer/Viewport.java +++ b/java/com/tigervnc/vncviewer/Viewport.java @@ -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) { |