5
0
mirror of git://git.proxmox.com/git/vncterm.git synced 2025-01-05 17:17:38 +03:00
vncterm/tigerpatches/javascript-events.patch
Dietmar Maurer 085cabefd0 re-enable javascript-events.patch
We need that to make reload on migration working.
2013-05-10 07:54:48 +02:00

112 lines
2.9 KiB
Diff

Index: new/java/src/com/tigervnc/vncviewer/VncViewer.java
===================================================================
--- new.orig/java/src/com/tigervnc/vncviewer/VncViewer.java 2013-05-10 07:41:18.000000000 +0200
+++ new/java/src/com/tigervnc/vncviewer/VncViewer.java 2013-05-10 07:41:18.000000000 +0200
@@ -27,11 +27,15 @@
package com.tigervnc.vncviewer;
+import netscape.javascript.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
+import java.awt.Graphics;
+import java.applet.Applet;
+
public class VncViewer extends java.applet.Applet
implements java.lang.Runnable, WindowListener, ComponentListener {
@@ -94,6 +98,9 @@
String PVECert;
+ JSObject jswin;
+ String myid;
+
// Reference to this applet for inter-applet communication.
public static java.applet.Applet refApplet;
@@ -129,6 +136,11 @@
refApplet = this;
+ if (inAnApplet) {
+ jswin = JSObject.getWindow(this);
+ myid = getParameter("id");
+ }
+
if (inSeparateFrame) {
vncFrame = new Frame("TigerVNC");
if (!inAnApplet) {
@@ -159,6 +171,9 @@
rfbThread = new Thread(this);
rfbThread.start();
+
+ String[] myparam = { myid, "init"};
+ jswin.call("PVE_vnc_console_event", myparam);
}
public void update(Graphics g) {
@@ -1002,6 +1017,8 @@
if (inAnApplet) {
showMessage("Disconnected");
+ String[] myparam = { myid, "disconnect"};
+ jswin.call("PVE_vnc_console_event", myparam);
} else {
System.exit(0);
}
@@ -1019,6 +1036,8 @@
// vncContainer null, applet not inited,
// can not present the error to the user.
Thread.currentThread().stop();
+ String[] myparam = { myid, "error", str};
+ jswin.call("PVE_vnc_console_event", myparam);
} else {
System.exit(1);
}
@@ -1040,6 +1059,8 @@
rfb.close();
if (inAnApplet) {
+ String[] myparam = { myid, "error", str};
+ jswin.call("PVE_vnc_console_event", myparam);
showMessage(str);
} else {
System.exit(1);
@@ -1109,6 +1130,9 @@
rfb.close();
if (inSeparateFrame)
vncFrame.dispose();
+
+ String[] myparam = { myid, "destroy"};
+ jswin.call("PVE_vnc_console_event", myparam);
}
//
@@ -1157,6 +1181,8 @@
if (!inAnApplet) {
System.exit(0);
}
+ String[] myparam = { myid, "close"};
+ jswin.call("PVE_vnc_console_event", myparam);
}
//
Index: new/java/src/com/tigervnc/vncviewer/Makefile
===================================================================
--- new.orig/java/src/com/tigervnc/vncviewer/Makefile 2013-05-10 07:41:18.000000000 +0200
+++ new/java/src/com/tigervnc/vncviewer/Makefile 2013-05-10 07:43:17.000000000 +0200
@@ -4,7 +4,7 @@
CP = cp
JC = javac
-JCFLAGS = -target 1.7 -classpath ../../../
+JCFLAGS = -target 1.7 -classpath ../../../ -Djava.ext.dirs=/usr/share/icedtea-web/
JAR = jar
ARCHIVE = VncViewer.jar
MANIFEST = MANIFEST.MF