mirror of
git://git.proxmox.com/git/vncterm.git
synced 2024-12-22 21:33:49 +03:00
36 lines
1.4 KiB
Diff
36 lines
1.4 KiB
Diff
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;
|