From bba54b0b14fded1d457f426cdc8843a34d6c9dc5 Mon Sep 17 00:00:00 2001 From: Brian Hinz Date: Thu, 6 Oct 2011 21:15:55 +0000 Subject: [PATCH] Fix rendering issue when scrollbars are present. Only set options.{autoScale,fixedRatioScale} when the options dialog is submitted git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4714 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- java/src/com/tigervnc/vncviewer/DesktopWindow.java | 5 ----- java/src/com/tigervnc/vncviewer/OptionsDialog.java | 14 ++++++-------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/java/src/com/tigervnc/vncviewer/DesktopWindow.java b/java/src/com/tigervnc/vncviewer/DesktopWindow.java index 54366155..f5acfff1 100644 --- a/java/src/com/tigervnc/vncviewer/DesktopWindow.java +++ b/java/src/com/tigervnc/vncviewer/DesktopWindow.java @@ -360,11 +360,6 @@ class DesktopWindow extends JPanel implements } } - public void repaint() { - if (graphics != null) - super.update(graphics); - } - String oldContents = ""; synchronized public void checkClipboard() { diff --git a/java/src/com/tigervnc/vncviewer/OptionsDialog.java b/java/src/com/tigervnc/vncviewer/OptionsDialog.java index 4913fade..9664dc99 100644 --- a/java/src/com/tigervnc/vncviewer/OptionsDialog.java +++ b/java/src/com/tigervnc/vncviewer/OptionsDialog.java @@ -292,6 +292,9 @@ class OptionsDialog extends Dialog implements veryLowColour.setEnabled(!autoSelect.isSelected()); compressLevel.setEnabled(customCompressLevel.isSelected()); qualityLevel.setEnabled(noJpeg.isSelected()); + autoScale = (scalingFactor.getSelectedItem().equals("Auto")); + fixedRatioScale = + (scalingFactor.getSelectedItem().equals("Fixed Aspect Ratio")); sendLocalUsername.setEnabled(secVeNCrypt.isEnabled()&& (secPlain.isSelected()||secIdent.isSelected())); } @@ -337,6 +340,9 @@ class OptionsDialog extends Dialog implements public void actionPerformed(ActionEvent e) { Object s = e.getSource(); if (s instanceof JButton && (JButton)s == okButton) { + autoScale = (scalingFactor.getSelectedItem().equals("Auto")); + fixedRatioScale = + (scalingFactor.getSelectedItem().equals("Fixed Aspect Ratio")); ok = true; if (cb != null) cb.getOptions(); endDialog(); @@ -383,14 +389,6 @@ class OptionsDialog extends Dialog implements qualityLevel.setEnabled(noJpeg.isSelected()); defaults.setPref("noJpeg",(noJpeg.isSelected()) ? "on" : "off"); } - if (s instanceof JComboBox && (JComboBox)s == scalingFactor) { - autoScale = fixedRatioScale = false; - if (scalingFactor.getSelectedItem().equals("Auto")) { - autoScale = true; - } else if (scalingFactor.getSelectedItem().equals("Fixed Aspect Ratio")) { - fixedRatioScale = true; - } - } if (s instanceof JCheckBox && (JCheckBox)s == sendLocalUsername) { defaults.setPref("sendLocalUsername",(sendLocalUsername.isSelected()) ? "on" : "off"); } -- 2.39.5