Send the focus back to the viewport after leaving the options dialog

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5027 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/java/com/tigervnc/vncviewer/OptionsDialog.java b/java/com/tigervnc/vncviewer/OptionsDialog.java
index cd21341..e78563e 100644
--- a/java/com/tigervnc/vncviewer/OptionsDialog.java
+++ b/java/com/tigervnc/vncviewer/OptionsDialog.java
@@ -470,6 +470,15 @@
     return c;
   }
 
+  public void endDialog() {
+    super.endDialog();
+    CConn cc = (CConn)cb;
+    if (cc.viewport != null && cc.viewport.isVisible()) {
+      cc.viewport.toFront();
+      cc.viewport.requestFocus();
+    }
+  }
+
   public void actionPerformed(ActionEvent e) {
     Object s = e.getSource();
     if (s instanceof JButton && (JButton)s == okButton) {