]> git.proxmox.com Git - vncterm.git/blobdiff - tigerpatches/fix-tab-button.patch
fix focus traversal
[vncterm.git] / tigerpatches / fix-tab-button.patch
diff --git a/tigerpatches/fix-tab-button.patch b/tigerpatches/fix-tab-button.patch
new file mode 100644 (file)
index 0000000..721b3b3
--- /dev/null
@@ -0,0 +1,35 @@
+Sources found at http://dogfeathers.com/mark/java7issue.html
+
+Index: tigervnc.new/java/src/com/tigervnc/vncviewer/VncViewer.java
+===================================================================
+--- tigervnc.new.orig/java/src/com/tigervnc/vncviewer/VncViewer.java   2012-08-21 09:05:04.000000000 +0200
++++ tigervnc.new/java/src/com/tigervnc/vncviewer/VncViewer.java        2012-08-21 09:10:27.000000000 +0200
+@@ -110,6 +110,28 @@
+   public void init() {
++    // fix focus traversal  
++    Container topParent = null;
++    Container parent = this;
++    // The natural thing would be to call getParent() until it returns
++    // null, but then you would be looping for a long time, since
++    // PluginEmbeddedFrame's getParent() returns itself.
++    for (int k=0; k < 10; k++) {
++      topParent = parent;
++      parent = parent.getParent();
++      if (parent == null) break;
++    }
++
++    // If topParent isn't a KeyEventDispatcher then we must be in some
++    // Plugin version that doesn't need the workaround.
++    try {
++      KeyEventDispatcher ked = (KeyEventDispatcher)topParent;
++      KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
++      // You have to remove it twice, otherwise the problem isn't fixed
++      kfm.removeKeyEventDispatcher(ked);
++      kfm.removeKeyEventDispatcher(ked);
++    } catch (ClassCastException e) {}
++
+     readParameters();
+     refApplet = this;