Commit 365a22c6 authored by runge's avatar runge

x11vnc: touchscreen uinput support and Java viewer mousewheel support. See...

x11vnc: touchscreen uinput support and Java viewer mousewheel support.  See x11vnc/ChangeLog for rest.
parent d4fabc21
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -2964,6 +2964,10 @@ if [ "X$use_ssh" = "X1" ]; then
fi
echo "ssh_pid='$pssh'"; echo
if [ "X$use_sshssl" = "X" -a "X$getport" = "X" ]; then
if [ "X$SSVNC_EXTRA_COMMAND" != "X" ]; then
(sh -c "$SSVNC_EXTRA_COMMAND") &
echo "($SSVNC_EXTRA_COMMAND) &"; echo
fi
echo "Running viewer:"
trap "final" 0 2 15
......@@ -3334,6 +3338,10 @@ if [ "X$direct_connect" != "X" ]; then
echo "T sleep $SSVNC_EXTRA_SLEEP"
sleep $SSVNC_EXTRA_SLEEP
fi
if [ "X$SSVNC_EXTRA_COMMAND" != "X" ]; then
(sh -c "$SSVNC_EXTRA_COMMAND") &
echo "($SSVNC_EXTRA_COMMAND) &"; echo
fi
if [ "X$reverse" = "X" ]; then
hostdisp="$host:$disp"
if [ "X$SSVNC_ULTRA_DSM" != "X" ]; then
......@@ -3568,6 +3576,10 @@ if [ "X$SSVNC_EXTRA_SLEEP" != "X" ]; then
echo "sleep $SSVNC_EXTRA_SLEEP"
sleep $SSVNC_EXTRA_SLEEP
fi
if [ "X$SSVNC_EXTRA_COMMAND" != "X" ]; then
(sh -c "$SSVNC_EXTRA_COMMAND") &
echo "($SSVNC_EXTRA_COMMAND) &"; echo
fi
if [ "X$reverse" = "X" ]; then
if [ "X$NEED_VENCRYPT_VIEWER_BRIDGE" = "X1" -a "X$ptmp" != "X" ] ; then
......
--- vnc_javasrc.orig/VncCanvas.java 2004-10-10 02:15:54.000000000 -0400
+++ vnc_javasrc/VncCanvas.java 2006-03-27 22:34:02.000000000 -0500
@@ -28,6 +28,7 @@
+++ vnc_javasrc/VncCanvas.java 2010-11-30 21:01:15.000000000 -0500
@@ -28,13 +28,14 @@
import java.lang.*;
import java.util.zip.*;
......@@ -8,6 +8,14 @@
//
// VncCanvas is a subclass of Canvas which draws a VNC desktop on it.
//
class VncCanvas extends Canvas
- implements KeyListener, MouseListener, MouseMotionListener {
+ implements KeyListener, MouseListener, MouseMotionListener, MouseWheelListener {
VncViewer viewer;
RfbProto rfb;
@@ -81,6 +82,20 @@
cm8 = new DirectColorModel(8, 7, (7 << 3), (3 << 6));
cm24 = new DirectColorModel(24, 0xFF0000, 0x00FF00, 0x0000FF);
......@@ -29,7 +37,53 @@
colors = new Color[256];
for (int i = 0; i < 256; i++)
colors[i] = new Color(cm8.getRGB(i));
@@ -1387,9 +1402,9 @@
@@ -169,6 +184,7 @@
inputEnabled = true;
addMouseListener(this);
addMouseMotionListener(this);
+ addMouseWheelListener(this);
if (viewer.showControls) {
viewer.buttonPanel.enableRemoteAccessControls(true);
}
@@ -177,6 +193,7 @@
inputEnabled = false;
removeMouseListener(this);
removeMouseMotionListener(this);
+ removeMouseWheelListener(this);
if (viewer.showControls) {
viewer.buttonPanel.enableRemoteAccessControls(false);
}
@@ -1190,6 +1207,9 @@
public void mouseDragged(MouseEvent evt) {
processLocalMouseEvent(evt, true);
}
+ public void mouseWheelMoved(MouseWheelEvent evt) {
+ processLocalMouseWheelEvent(evt);
+ }
public void processLocalKeyEvent(KeyEvent evt) {
if (viewer.rfb != null && rfb.inNormalProtocol) {
@@ -1221,6 +1241,19 @@
evt.consume();
}
+ public void processLocalMouseWheelEvent(MouseWheelEvent evt) {
+ if (viewer.rfb != null && rfb.inNormalProtocol) {
+ synchronized(rfb) {
+ try {
+ rfb.writeWheelEvent(evt);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ rfb.notify();
+ }
+ }
+ }
+
public void processLocalMouseEvent(MouseEvent evt, boolean moved) {
if (viewer.rfb != null && rfb.inNormalProtocol) {
if (moved) {
@@ -1387,9 +1420,9 @@
result = cm8.getRGB(pixBuf[i]);
} else {
result = 0xFF000000 |
......@@ -42,7 +96,7 @@
}
} else {
result = 0; // Transparent pixel
@@ -1403,9 +1418,9 @@
@@ -1403,9 +1436,9 @@
result = cm8.getRGB(pixBuf[i]);
} else {
result = 0xFF000000 |
......
diff -x VncCanvas.java -Naur vnc_javasrc.orig/Makefile vnc_javasrc/Makefile
diff -Naur vnc_javasrc.orig/Makefile vnc_javasrc/Makefile
--- vnc_javasrc.orig/Makefile 2004-03-04 08:34:25.000000000 -0500
+++ vnc_javasrc/Makefile 2010-05-18 20:56:26.000000000 -0400
@@ -4,6 +4,7 @@
......@@ -44,9 +44,9 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/Makefile vnc_javasrc/Makefile
export:: $(CLASSES) $(ARCHIVE) $(PAGES)
@$(ExportJavaClasses)
diff -x VncCanvas.java -Naur vnc_javasrc.orig/RfbProto.java vnc_javasrc/RfbProto.java
diff -Naur vnc_javasrc.orig/RfbProto.java vnc_javasrc/RfbProto.java
--- vnc_javasrc.orig/RfbProto.java 2004-03-04 08:34:25.000000000 -0500
+++ vnc_javasrc/RfbProto.java 2010-03-27 17:58:37.000000000 -0400
+++ vnc_javasrc/RfbProto.java 2010-11-30 22:05:12.000000000 -0500
@@ -199,7 +199,21 @@
host = h;
port = p;
......@@ -79,7 +79,46 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/RfbProto.java vnc_javasrc/RfbProto
}
serverMajor = (b[4] - '0') * 100 + (b[5] - '0') * 10 + (b[6] - '0');
@@ -992,6 +1006,19 @@
@@ -892,6 +906,38 @@
final static int ALT_MASK = InputEvent.ALT_MASK;
+ void writeWheelEvent(MouseWheelEvent evt) throws IOException {
+
+ eventBufLen = 0;
+
+ int x = evt.getX();
+ int y = evt.getY();
+
+ if (x < 0) x = 0;
+ if (y < 0) y = 0;
+
+ int ptrmask;
+
+ int clicks = evt.getWheelRotation();
+ System.out.println("writeWheelEvent: clicks: " + clicks);
+ if (clicks > 0) {
+ ptrmask = 16;
+ } else if (clicks < 0) {
+ ptrmask = 8;
+ } else {
+ return;
+ }
+
+ eventBuf[eventBufLen++] = (byte) PointerEvent;
+ eventBuf[eventBufLen++] = (byte) ptrmask;
+ eventBuf[eventBufLen++] = (byte) ((x >> 8) & 0xff);
+ eventBuf[eventBufLen++] = (byte) (x & 0xff);
+ eventBuf[eventBufLen++] = (byte) ((y >> 8) & 0xff);
+ eventBuf[eventBufLen++] = (byte) (y & 0xff);
+
+ os.write(eventBuf, 0, eventBufLen);
+ }
+
//
// Write a pointer event message. We may need to send modifier key events
// around it to set the correct modifier state.
@@ -992,6 +1038,19 @@
boolean down = (evt.getID() == KeyEvent.KEY_PRESSED);
int key;
......@@ -99,7 +138,7 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/RfbProto.java vnc_javasrc/RfbProto
if (evt.isActionKey()) {
//
@@ -1025,6 +1052,13 @@
@@ -1025,6 +1084,13 @@
return;
}
......@@ -113,7 +152,7 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/RfbProto.java vnc_javasrc/RfbProto
} else {
//
@@ -1036,6 +1070,7 @@
@@ -1036,6 +1102,7 @@
key = keyChar;
......@@ -121,7 +160,7 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/RfbProto.java vnc_javasrc/RfbProto
if (key < 0x20) {
if (evt.isControlDown()) {
key += 0x60;
@@ -1121,6 +1156,16 @@
@@ -1121,6 +1188,16 @@
int oldModifiers = 0;
void writeModifierKeyEvents(int newModifiers) {
......@@ -138,7 +177,7 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/RfbProto.java vnc_javasrc/RfbProto
if ((newModifiers & CTRL_MASK) != (oldModifiers & CTRL_MASK))
writeKeyEvent(0xffe3, (newModifiers & CTRL_MASK) != 0);
diff -x VncCanvas.java -Naur vnc_javasrc.orig/SSLSocketToMe.java vnc_javasrc/SSLSocketToMe.java
diff -Naur vnc_javasrc.orig/SSLSocketToMe.java vnc_javasrc/SSLSocketToMe.java
--- vnc_javasrc.orig/SSLSocketToMe.java 1969-12-31 19:00:00.000000000 -0500
+++ vnc_javasrc/SSLSocketToMe.java 2010-07-10 19:18:06.000000000 -0400
@@ -0,0 +1,2067 @@
......@@ -2209,7 +2248,119 @@ diff -x VncCanvas.java -Naur vnc_javasrc.orig/SSLSocketToMe.java vnc_javasrc/SSL
+ private Base64Coder() {}
+
+}
diff -x VncCanvas.java -Naur vnc_javasrc.orig/VncViewer.java vnc_javasrc/VncViewer.java
diff -Naur vnc_javasrc.orig/VncCanvas.java vnc_javasrc/VncCanvas.java
--- vnc_javasrc.orig/VncCanvas.java 2004-10-10 02:15:54.000000000 -0400
+++ vnc_javasrc/VncCanvas.java 2010-11-30 21:01:15.000000000 -0500
@@ -28,13 +28,14 @@
import java.lang.*;
import java.util.zip.*;
+import java.util.Collections;
//
// VncCanvas is a subclass of Canvas which draws a VNC desktop on it.
//
class VncCanvas extends Canvas
- implements KeyListener, MouseListener, MouseMotionListener {
+ implements KeyListener, MouseListener, MouseMotionListener, MouseWheelListener {
VncViewer viewer;
RfbProto rfb;
@@ -81,6 +82,20 @@
cm8 = new DirectColorModel(8, 7, (7 << 3), (3 << 6));
cm24 = new DirectColorModel(24, 0xFF0000, 0x00FF00, 0x0000FF);
+ // kludge to not show any Java cursor in the canvas since we are
+ // showing the soft cursor (should be a user setting...)
+ Cursor dot = Toolkit.getDefaultToolkit().createCustomCursor(
+ Toolkit.getDefaultToolkit().createImage(new byte[4]), new Point(0,0),
+ "dot");
+ this.setCursor(dot);
+
+ // while we are at it... get rid of the keyboard traversals that
+ // make it so we can't type a Tab character:
+ this.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
+ Collections.EMPTY_SET);
+ this.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
+ Collections.EMPTY_SET);
+
colors = new Color[256];
for (int i = 0; i < 256; i++)
colors[i] = new Color(cm8.getRGB(i));
@@ -169,6 +184,7 @@
inputEnabled = true;
addMouseListener(this);
addMouseMotionListener(this);
+ addMouseWheelListener(this);
if (viewer.showControls) {
viewer.buttonPanel.enableRemoteAccessControls(true);
}
@@ -177,6 +193,7 @@
inputEnabled = false;
removeMouseListener(this);
removeMouseMotionListener(this);
+ removeMouseWheelListener(this);
if (viewer.showControls) {
viewer.buttonPanel.enableRemoteAccessControls(false);
}
@@ -1190,6 +1207,9 @@
public void mouseDragged(MouseEvent evt) {
processLocalMouseEvent(evt, true);
}
+ public void mouseWheelMoved(MouseWheelEvent evt) {
+ processLocalMouseWheelEvent(evt);
+ }
public void processLocalKeyEvent(KeyEvent evt) {
if (viewer.rfb != null && rfb.inNormalProtocol) {
@@ -1221,6 +1241,19 @@
evt.consume();
}
+ public void processLocalMouseWheelEvent(MouseWheelEvent evt) {
+ if (viewer.rfb != null && rfb.inNormalProtocol) {
+ synchronized(rfb) {
+ try {
+ rfb.writeWheelEvent(evt);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ rfb.notify();
+ }
+ }
+ }
+
public void processLocalMouseEvent(MouseEvent evt, boolean moved) {
if (viewer.rfb != null && rfb.inNormalProtocol) {
if (moved) {
@@ -1387,9 +1420,9 @@
result = cm8.getRGB(pixBuf[i]);
} else {
result = 0xFF000000 |
- (pixBuf[i * 4 + 1] & 0xFF) << 16 |
- (pixBuf[i * 4 + 2] & 0xFF) << 8 |
- (pixBuf[i * 4 + 3] & 0xFF);
+ (pixBuf[i * 4 + 2] & 0xFF) << 16 |
+ (pixBuf[i * 4 + 1] & 0xFF) << 8 |
+ (pixBuf[i * 4 + 0] & 0xFF);
}
} else {
result = 0; // Transparent pixel
@@ -1403,9 +1436,9 @@
result = cm8.getRGB(pixBuf[i]);
} else {
result = 0xFF000000 |
- (pixBuf[i * 4 + 1] & 0xFF) << 16 |
- (pixBuf[i * 4 + 2] & 0xFF) << 8 |
- (pixBuf[i * 4 + 3] & 0xFF);
+ (pixBuf[i * 4 + 2] & 0xFF) << 16 |
+ (pixBuf[i * 4 + 1] & 0xFF) << 8 |
+ (pixBuf[i * 4 + 0] & 0xFF);
}
} else {
result = 0; // Transparent pixel
diff -Naur vnc_javasrc.orig/VncViewer.java vnc_javasrc/VncViewer.java
--- vnc_javasrc.orig/VncViewer.java 2004-03-04 08:34:25.000000000 -0500
+++ vnc_javasrc/VncViewer.java 2010-03-27 17:57:04.000000000 -0400
@@ -29,6 +29,7 @@
......
......@@ -1685,7 +1685,7 @@ diff -Naur JavaViewer.orig/OptionsFrame.java JavaViewer/OptionsFrame.java
choices[shareDesktopIndex].select("Yes");
diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
--- JavaViewer.orig/RfbProto.java 2006-05-24 15:14:40.000000000 -0400
+++ JavaViewer/RfbProto.java 2010-03-27 17:59:56.000000000 -0400
+++ JavaViewer/RfbProto.java 2010-11-30 22:13:58.000000000 -0500
@@ -31,6 +31,7 @@
import java.net.Socket;
import java.util.*;
......@@ -2662,7 +2662,45 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
os.write(b);
// }
@@ -1610,6 +1971,21 @@
@@ -1506,6 +1867,37 @@
final static int META_MASK = InputEvent.META_MASK;
final static int ALT_MASK = InputEvent.ALT_MASK;
+ void writeWheelEvent(MouseWheelEvent evt) throws IOException {
+ eventBufLen = 0;
+
+ int x = evt.getX();
+ int y = evt.getY();
+
+ if (x < 0) x = 0;
+ if (y < 0) y = 0;
+
+ int ptrmask;
+
+ int clicks = evt.getWheelRotation();
+ System.out.println("writeWheelEvent: clicks: " + clicks);
+ if (clicks > 0) {
+ ptrmask = 16;
+ } else if (clicks < 0) {
+ ptrmask = 8;
+ } else {
+ return;
+ }
+
+ eventBuf[eventBufLen++] = (byte) PointerEvent;
+ eventBuf[eventBufLen++] = (byte) ptrmask;
+ eventBuf[eventBufLen++] = (byte) ((x >> 8) & 0xff);
+ eventBuf[eventBufLen++] = (byte) (x & 0xff);
+ eventBuf[eventBufLen++] = (byte) ((y >> 8) & 0xff);
+ eventBuf[eventBufLen++] = (byte) (y & 0xff);
+
+ os.write(eventBuf, 0, eventBufLen);
+ }
+
//
// Write a pointer event message. We may need to send modifier key events
// around it to set the correct modifier state.
@@ -1610,6 +2002,21 @@
boolean down = (evt.getID() == KeyEvent.KEY_PRESSED);
......@@ -2684,7 +2722,7 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
int key;
if (evt.isActionKey()) {
@@ -1685,6 +2061,9 @@
@@ -1685,6 +2092,9 @@
default :
return;
}
......@@ -2694,7 +2732,7 @@ diff -Naur JavaViewer.orig/RfbProto.java JavaViewer/RfbProto.java
} else {
@@ -1794,6 +2173,16 @@
@@ -1794,6 +2204,16 @@
int oldModifiers = 0;
void writeModifierKeyEvents(int newModifiers) {
......@@ -4784,18 +4822,31 @@ diff -Naur JavaViewer.orig/SSLSocketToMe.java JavaViewer/SSLSocketToMe.java
+}
diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java
--- JavaViewer.orig/VncCanvas.java 2005-11-21 18:50:18.000000000 -0500
+++ JavaViewer/VncCanvas.java 2007-05-31 15:33:20.000000000 -0400
@@ -27,6 +27,9 @@
+++ JavaViewer/VncCanvas.java 2010-11-30 22:57:50.000000000 -0500
@@ -27,6 +27,13 @@
import java.lang.*;
import java.util.zip.*;
+// begin runge/x11vnc
+import java.util.Collections;
+// end runge/x11vnc
+
+// begin runge/x11vnc
+// all the MouseWheel stuff below.
+// end runge/x11vnc
//
// VncCanvas is a subclass of Canvas which draws a VNC desktop on it.
@@ -85,6 +88,22 @@
@@ -34,7 +41,7 @@
class VncCanvas
extends Canvas
- implements KeyListener, MouseListener, MouseMotionListener {
+ implements KeyListener, MouseListener, MouseMotionListener, MouseWheelListener {
VncViewer viewer;
RfbProto rfb;
@@ -85,6 +92,22 @@
cm24 = new DirectColorModel(24, 0xFF0000, 0x00FF00, 0x0000FF);
......@@ -4818,7 +4869,23 @@ diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java
colors = new Color[256];
// sf@2005 - Now Default
for (int i = 0; i < 256; i++)
@@ -202,6 +221,9 @@
@@ -186,6 +209,7 @@
inputEnabled = true;
addMouseListener(this);
addMouseMotionListener(this);
+ addMouseWheelListener(this);
if (viewer.showControls) {
viewer.buttonPanel.enableRemoteAccessControls(true);
}
@@ -193,6 +217,7 @@
inputEnabled = false;
removeMouseListener(this);
removeMouseMotionListener(this);
+ removeMouseWheelListener(this);
if (viewer.showControls) {
viewer.buttonPanel.enableRemoteAccessControls(false);
}
@@ -202,6 +227,9 @@
public void setPixelFormat() throws IOException {
// sf@2005 - Adding more color modes
......@@ -4828,7 +4895,7 @@ diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java
if (viewer.options.eightBitColors > 0)
{
viewer.options.oldEightBitColors = viewer.options.eightBitColors;
@@ -237,6 +259,9 @@
@@ -237,6 +265,9 @@
}
else
{
......@@ -4838,7 +4905,7 @@ diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java
rfb.writeSetPixelFormat(
32,
24,
@@ -376,12 +401,14 @@
@@ -376,12 +407,14 @@
// Start/stop session recording if necessary.
viewer.checkRecordingStatus();
......@@ -4859,7 +4926,7 @@ diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java
//
// main dispatch loop
@@ -390,6 +417,9 @@
@@ -390,6 +423,9 @@
while (true) {
// Read message type from the server.
int msgType = rfb.readServerMessageType();
......@@ -4869,7 +4936,37 @@ diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java
// Process the message depending on its type.
switch (msgType) {
@@ -1532,9 +1562,14 @@
@@ -1332,6 +1368,9 @@
public void mouseDragged(MouseEvent evt) {
processLocalMouseEvent(evt, true);
}
+ public void mouseWheelMoved(MouseWheelEvent evt) {
+ processLocalMouseWheelEvent(evt);
+ }
public void processLocalKeyEvent(KeyEvent evt) {
if (viewer.rfb != null && rfb.inNormalProtocol) {
@@ -1367,6 +1406,19 @@
evt.consume();
}
+ public void processLocalMouseWheelEvent(MouseWheelEvent evt) {
+ if (viewer.rfb != null && rfb.inNormalProtocol) {
+ synchronized(rfb) {
+ try {
+ rfb.writeWheelEvent(evt);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ rfb.notify();
+ }
+ }
+ }
+
public void processLocalMouseEvent(MouseEvent evt, boolean moved) {
if (viewer.rfb != null && rfb.inNormalProtocol) {
if (moved) {
@@ -1532,9 +1584,14 @@
else
{
result =
......@@ -4887,7 +4984,7 @@ diff -Naur JavaViewer.orig/VncCanvas.java JavaViewer/VncCanvas.java
}
} else {
result = 0; // Transparent pixel
@@ -1565,9 +1600,14 @@
@@ -1565,9 +1622,14 @@
else
{
result =
......
......@@ -19,7 +19,7 @@ sed -e "s/LibVNCServer, [^,)]*\([(,]\)*/x11vnc, $VERSION\1/g" \
mv Makefile.am Makefile.am.LibVNCServer
echo "EXTRA_DIST=tightvnc-1.3dev5-vncviewer-alpha-cursor.patch README.LibVNCServer" > Makefile.am
echo "EXTRA_DIST=tightvnc-1.3dev5-vncviewer-alpha-cursor.patch RELEASE-NOTES README.LibVNCServer" > Makefile.am
echo "" >> Makefile.am
echo "if HAVE_SYSTEM_LIBVNCSERVER" >> Makefile.am
echo "SUBDIRS=x11vnc classes" >> Makefile.am
......@@ -41,6 +41,7 @@ sed -e "s/^SUBDIRS.*$/#SUBDIRS=libvncserver libvncclient x11vnc classes/" \
mv README README.LibVNCServer
cp x11vnc/README ./README
cp x11vnc/RELEASE-NOTES ./RELEASE-NOTES
cat LibVNCServer.spec.in | \
sed -e "s/Johannes.Schindelin@gmx.de/runge@karlrunge.com/gi" \
......@@ -134,4 +135,5 @@ make x11vnc-${VERSION}.tar.gz
for f in configure.ac Makefile.am x11vnc/Makefile.am libvncserver/Makefile.am libvncclient/Makefile.am classes/Makefile.am classes/ssl/Makefile.am acinclude.m4 README; do
mv -f $f.LibVNCServer $f
done
rm -f ./RELEASE-NOTES
......@@ -720,7 +720,7 @@ static int check_depth_win(Window win, Window top, XWindowAttributes *attr) {
if (store_it) {
int i, j = -1, none = -1, nomap = -1;
int new = 0;
int newc = 0;
if (attr->map_state == IsViewable) {
/* count the visible ones: */
multivis_count++;
......@@ -754,7 +754,7 @@ if (db24 > 1) fprintf(stderr, "multivis: 0x%lx %d\n", win, attr->depth);
} else if (none >= 0) {
/* put it in the first None slot */
j = none;
new = 1;
newc = 1;
} else if (nomap >=0) {
/* put it in the first unmapped slot */
j = nomap;
......@@ -791,8 +791,8 @@ if (db24 > 1) fprintf(stderr, "multivis: STORE 0x%lx j: %3d ms: %d dep=%d\n", wi
windows_8bpp[j].x = x;
windows_8bpp[j].y = y;
if (new || now_vis) {
if (db24) fprintf(stderr, "new/now_vis: 0x%lx %d/%d\n", win, new, now_vis);
if (newc || now_vis) {
if (db24) fprintf(stderr, "new/now_vis: 0x%lx %d/%d\n", win, newc, now_vis);
/* mark it immediately if a new one: */
X_UNLOCK; /* dont forget the giant lock */
mark_rect_as_modified(x, y, x + attr->width,
......
2010-12-21 Karl Runge <runge@karlrunge.com>
* x11vnc: Add RELEASE-NOTES. Call shutdown_uinput() when exiting.
Free some minor memory. Do not use GetMainDevice() on macosx.
Add utility scripts qt_tslib_inject.pl and uinput.pl. Option
-ungrabboth (not useful.) X11VNC_SB_FACTOR -sb user tweak.
X11VNC_REFLECT_{bitsPerSample,samplesPerPixel,bytesPerPixel}
for -reflect vncclient. Fix minor fd leaks. For -create mode
preserve LC_ALL; FIND_DISPLAY_NO_VT_FIND, FIND_DISPLAY_NO_LSOF,
and X11VNC_CREATE_LC_ALL_C_OK. Speed up -find and -create scripts
for large installations. Enable direct event input modes to
bypass uinput. TSLIB support for uinput touchscreens. Handle
pressure events on touchscreens. User can set X11VNC_UINPUT_BUS
and X11VNC_UINPUT_VERSION. Allow Tab switch in -create login:
prompt. Fix bug in setting bpp for -rawfb. Java viewers now
handle mousewheel events. No vars named new.
2010-09-10 Karl Runge <runge@karlrunge.com>
* x11vnc: update classes/ssl jars, patches, and script.
update prepare_x11vnc_dist.sh to 0.9.13. Makefile.am no top_srcdir
......
......@@ -16,7 +16,7 @@ desktopdir = $(datadir)/applications
desktop_DATA = x11vnc.desktop
man_MANS=x11vnc.1
EXTRA_DIST=ChangeLog README tkx11vnc $(man_MANS) $(desktop_DATA)
EXTRA_DIST=ChangeLog README RELEASE-NOTES tkx11vnc $(man_MANS) $(desktop_DATA)
if CYGIPC
LD_CYGIPC=-lcygipc
......
This diff is collapsed.
This diff is collapsed.
......@@ -1358,7 +1358,7 @@ static void list_apps(void) {
static int process_control(char *file, int check_clients) {
int i, nnew = 0, seen[CMAX];
char line[1024], *new[CMAX];
char line[1024], *newctl[CMAX];
FILE *f;
f = fopen(file, "r");
......@@ -1481,7 +1481,7 @@ static int process_control(char *file, int check_clients) {
if (idx >= 0) {
seen[idx] = 1;
} else {
new[nnew++] = strdup(q);
newctl[nnew++] = strdup(q);
}
}
}
......@@ -1509,8 +1509,8 @@ static int process_control(char *file, int check_clients) {
}
continue;
}
clients[free] = new[i];
client(new[i], 1);
clients[free] = newctl[i];
client(newctl[i], 1);
}
}
return 1;
......
......@@ -50,6 +50,7 @@ so, delete this exception statement from your version.
#include "screen.h"
#include "xrecord.h"
#include "xevents.h"
#include "uinput.h"
/*
* Exiting and error handling routines
......@@ -187,6 +188,8 @@ void clean_up_exit(int ret) {
pipeinput_fh = NULL;
}
shutdown_uinput();
if (! dpy) { /* raw_rb hack */
if (rm_flagfile) {
unlink(rm_flagfile);
......
......@@ -81,26 +81,26 @@ static Window tweak_tk_window_id(Window win) {
return None;
#else
char *name = NULL;
Window parent, new;
Window parent, new_win;
if (getenv("NO_TWEAK_TK_WINDOW_ID")) {
return win;
}
/* hack for tk, does not report outermost window */
new = win;
new_win = win;
parent = parent_window(win, &name);
if (parent && name != NULL) {
lowercase(name);
if (strstr(name, "wish") || strstr(name, "x11vnc")) {
new = parent;
new_win = parent;
rfbLog("tray_embed: using parent: %s\n", name);
}
}
if (name != NULL) {
XFree_wr(name);
}
return new;
return new_win;
#endif /* NO_X11 */
}
......
This diff is collapsed.
......@@ -61,7 +61,7 @@ void check_add_keysyms(void);
int add_keysym(KeySym keysym);
void delete_added_keycodes(int bequiet);
void initialize_remap(char *infile);
int sloppy_key_check(int key, rfbBool down, rfbKeySym keysym, int *new);
int sloppy_key_check(int key, rfbBool down, rfbKeySym keysym, int *new_kc);
void switch_to_xkb_if_better(void);
char *short_kmbcf(char *str);
void initialize_allowed_input(void);
......@@ -518,7 +518,7 @@ int add_keysym(KeySym keysym) {
for (kc = minkey+1; kc <= maxkey; kc++) {
int i, j, didmsg = 0, is_empty = 1;
char *str;
KeySym new[8];
KeySym newks[8];
for (n=0; n < syms_per_keycode; n++) {
if (keymap[ (kc-minkey) * syms_per_keycode + n]
......@@ -532,19 +532,19 @@ int add_keysym(KeySym keysym) {
}
for (i=0; i<8; i++) {
new[i] = NoSymbol;
newks[i] = NoSymbol;
}
if (add_keysyms == 2) {
new[0] = keysym; /* XXX remove me */
newks[0] = keysym; /* XXX remove me */
} else {
for(i=0; i < syms_per_keycode; i++) {
new[i] = keysym;
newks[i] = keysym;
if (i >= 7) break;
}
}
XChangeKeyboardMapping(dpy, kc, syms_per_keycode,
new, 1);
newks, 1);
if (alltime_num >= alltime_len) {
didmsg = 1; /* something weird */
......@@ -584,7 +584,7 @@ static void delete_keycode(KeyCode kc, int bequiet) {
#else
int minkey, maxkey, syms_per_keycode, i;
KeySym *keymap;
KeySym ksym, new[8];
KeySym ksym, newks[8];
char *str;
RAWFB_RET_VOID
......@@ -594,10 +594,10 @@ static void delete_keycode(KeyCode kc, int bequiet) {
&syms_per_keycode);
for (i=0; i<8; i++) {
new[i] = NoSymbol;
newks[i] = NoSymbol;
}
XChangeKeyboardMapping(dpy, kc, syms_per_keycode, new, 1);
XChangeKeyboardMapping(dpy, kc, syms_per_keycode, newks, 1);
if (! bequiet && ! quiet) {
ksym = XKeycodeToKeysym(dpy, kc, 0);
......@@ -907,14 +907,14 @@ static int kc1_shift, kc1_control, kc1_caplock, kc1_alt;
static int kc1_meta, kc1_numlock, kc1_super, kc1_hyper;
static int kc1_mode_switch, kc1_iso_level3_shift, kc1_multi_key;
int sloppy_key_check(int key, rfbBool down, rfbKeySym keysym, int *new) {
int sloppy_key_check(int key, rfbBool down, rfbKeySym keysym, int *new_kc) {
if (!sloppy_keys) {
return 0;
}
RAWFB_RET(0)
#if NO_X11
if (!key || !down || !keysym || !new) {}
if (!key || !down || !keysym || !new_kc) {}
return 0;
#else
......@@ -958,7 +958,7 @@ int sloppy_key_check(int key, rfbBool down, rfbKeySym keysym, int *new) {
"-> %d/0x%x (nmods: %d)\n", (int) key,
(int) key, downkey, downkey, nmods_down);
}
*new = downkey;
*new_kc = downkey;
return 1;
}
}
......
......@@ -48,7 +48,7 @@ extern void check_add_keysyms(void);
extern int add_keysym(KeySym keysym);
extern void delete_added_keycodes(int bequiet);
extern void initialize_remap(char *infile);
extern int sloppy_key_check(int key, rfbBool down, rfbKeySym keysym, int *new);
extern int sloppy_key_check(int key, rfbBool down, rfbKeySym keysym, int *new_kc);
extern void switch_to_xkb_if_better(void);
extern char *short_kmbcf(char *str);
extern void initialize_allowed_input(void);
......
......@@ -265,6 +265,7 @@ char *console_guess(char *str, int *fd) {
} else {
sprintf(q, "map:%s@%s", file, atparms);
}
free(atparms);
return q;
}
......
......@@ -241,6 +241,7 @@ char *macosx_console_guess(char *str, int *fd) {
q = (char *) malloc(strlen("map:macosx:") + strlen(file) + 1 + strlen(atparms) + 1);
sprintf(q, "map:macosx:%s@%s", file, atparms);
free(atparms);
return q;
}
......
......@@ -87,7 +87,9 @@ int dragum(void) {
CGPoint loc;
CGDirectDisplayID displayID2 = kCGDirectMainDisplay;
#ifdef X11VNC_MACOSX_USE_GETMAINDEVICE
(void) GetMainDevice();
#endif
for (i=0; i< 50; i++) {
usleep(1000*100);
......@@ -140,7 +142,9 @@ void macosxCG_init(void) {
#endif
displayID = kCGDirectMainDisplay;
#ifdef X11VNC_MACOSX_USE_GETMAINDEVICE
(void) GetMainDevice();
#endif
CGSetLocalEventsSuppressionInterval(0.0);
CGSetLocalEventsFilterDuringSupressionState(
......
SUBDIRS = turbovnc
DIST_SUBDIRS = turbovnc
EXTRA_DIST=README blockdpy.c dtVncPopup rx11vnc rx11vnc.pl shm_clear ranfb.pl slide.pl vcinject.pl x11vnc_loop Xdummy ultravnc_repeater.pl connect_switch panner.pl desktop.cgi inet6to4
EXTRA_DIST=README blockdpy.c dtVncPopup rx11vnc rx11vnc.pl shm_clear ranfb.pl slide.pl vcinject.pl x11vnc_loop Xdummy ultravnc_repeater.pl connect_switch panner.pl desktop.cgi inet6to4 uinput.pl qt_tslib_inject.pl
......@@ -26,6 +26,10 @@ x11vnc -pipeinput/-rawfb utilities:
slide.pl amusing example using x11vnc -rawfb for jpeg slideshow.
ranfb.pl example -rawfb setup:./ranfb.pl to set up a framebuffer.
uinput.pl test perl script for Linux uinput injection.
qt_tslib_inject.pl touchscreen -pipeinput helper for tslib on qtmoko.
Misc. scripts:
shm_clear list or remove orphaned shm slots from hard x11vnc crashes.
......
This diff is collapsed.
This diff is collapsed.
......@@ -620,24 +620,24 @@ static void pipe_pointer(int mask, int x, int y, rfbClientPtr client) {
if (mask == button_mask) {
strcat(hint, "None");
} else {
int i, old, new, m = 1, cnt = 0;
int i, old, newb, m = 1, cnt = 0;
for (i=0; i<MAX_BUTTONS; i++) {
char s[20];
old = button_mask & m;
new = mask & m;
newb = mask & m;
m = m << 1;
if (old == new) {
if (old == newb) {
continue;
}
if (hint[0] != '\0') {
strcat(hint, ",");
}
if (new && ! old) {
if (newb && ! old) {
sprintf(s, "ButtonPress-%d", i+1);
cnt++;
} else if (! new && old) {
} else if (! newb && old) {
sprintf(s, "ButtonRelease-%d", i+1);
cnt++;
}
......
......@@ -74,8 +74,8 @@ char *process_remote_cmd(char *cmd, int stringonly);
static char *add_item(char *instr, char *item);
static char *delete_item(char *instr, char *item);
static void if_8bpp_do_new_fb(void);
static void reset_httpport(int old, int new);
static void reset_rfbport(int old, int new) ;
static void reset_httpport(int old, int newp);
static void reset_rfbport(int old, int newp) ;
char *query_result = NULL;
......@@ -563,8 +563,8 @@ void http_connections(int on) {
}
}
static void reset_httpport(int old, int new) {
int hp = new;
static void reset_httpport(int old, int newp) {
int hp = newp;
if (! screen->httpDir) {
return;
......@@ -619,8 +619,8 @@ static void reset_httpport(int old, int new) {
}
}
static void reset_rfbport(int old, int new) {
int rp = new;
static void reset_rfbport(int old, int newp) {
int rp = newp;
if (inetd) {
rfbLog("reset_rfbport: cannot set rfbport: %d in inetd.\n", rp);
......@@ -2303,7 +2303,7 @@ char *process_remote_cmd(char *cmd, int stringonly) {
* safe_remote_only but at least the command names
* are fixed.
*/
char *new;
char *newc;
int doit = 1;
COLON_CHECK("solid_color:")
if (query) {
......@@ -2313,19 +2313,19 @@ char *process_remote_cmd(char *cmd, int stringonly) {
}
p += strlen("solid_color:");
if (*p != '\0') {
new = strdup(p);
newc = strdup(p);
} else {
new = strdup(solid_default);
newc = strdup(solid_default);
}
rfbLog("remote_cmd: solid %s -> %s\n", NONUL(solid_str), new);
rfbLog("remote_cmd: solid %s -> %s\n", NONUL(solid_str), newc);
if (solid_str) {
if (!strcmp(solid_str, new)) {
if (!strcmp(solid_str, newc)) {
doit = 0;
}
free(solid_str);
}
solid_str = new;
solid_str = newc;
use_solid_bg = 1;
if (raw_fb && !macosx_console) set_raw_fb_params(0);
......@@ -4213,6 +4213,24 @@ char *process_remote_cmd(char *cmd, int stringonly) {
rfbLog("enabled grab_ptr\n");
goto done;
}
if (!strcmp(p, "ungrabboth")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, ungrab_both);
goto qry;
}
ungrab_both = 1;
rfbLog("enabled ungrab_both\n");
goto done;
}
if (!strcmp(p, "noungrabboth")) {
if (query) {
snprintf(buf, bufn, "ans=%s:%d", p, !ungrab_both);
goto qry;
}
ungrab_both = 0;
rfbLog("disabled ungrab_both\n");
goto done;
}
if (!strcmp(p, "nograbptr")) {
int orig = grab_ptr;
if (query) {
......
......@@ -2961,7 +2961,17 @@ static void nap_check(int tile_cnt) {
now = time(NULL);
if (screen_blank > 0) {
int dt_ev, dt_fbu, ms = 2000;
int dt_ev, dt_fbu;
static int ms = 0;
if (ms == 0) {
ms = 2000;
if (getenv("X11VNC_SB_FACTOR")) {
ms = ms * atof(getenv("X11VNC_SB_FACTOR"));
}
if (ms <= 0) {
ms = 2000;
}
}
/* if no activity, pause here for a second or so. */
dt_ev = (int) (now - last_event);
......
......@@ -1461,7 +1461,19 @@ char *vnc_reflect_guess(char *str, char **raw_fb_addr) {
char *str0 = strdup(str);
if (client == NULL) {
client = rfbGetClient(8, 3, 4);
int bitsPerSample = 8;
int samplesPerPixel = 3;
int bytesPerPixel = 4;
char *s;
s = getenv("X11VNC_REFLECT_bitsPerSample");
if (s) bitsPerSample = atoi(s);
s = getenv("X11VNC_REFLECT_samplesPerPixel");
if (s) samplesPerPixel = atoi(s);
s = getenv("X11VNC_REFLECT_bytesPerPixel");
if (s) bytesPerPixel = atoi(s);
rfbLog("rfbGetClient(bitsPerSample=%d, samplesPerPixel=%d, bytesPerPixel=%d)\n",
bitsPerSample, samplesPerPixel, bytesPerPixel);
client = rfbGetClient(bitsPerSample, samplesPerPixel, bytesPerPixel);
}
rfbLog("rawfb: %s\n", str);
......@@ -2086,16 +2098,16 @@ if (db) fprintf(stderr, "initialize_raw_fb reset\n");
/* hmmm, not following directions, see if map: applies */
struct stat sbuf;
if (stat(str, &sbuf) == 0) {
char *new;
char *newstr;
int len = strlen("map:") + strlen(str) + 1;
rfbLog("no type prefix: %s\n", raw_fb_str);
rfbLog(" but file exists, so assuming: map:%s\n",
raw_fb_str);
new = (char *) malloc(len);
strcpy(new, "map:");
strcat(new, str);
newstr = (char *) malloc(len);
strcpy(newstr, "map:");
strcat(newstr, str);
free(str);
str = new;
str = newstr;
}
}
......
......@@ -125,17 +125,17 @@ char *get_saved_pem(char *save, int create) {
sprintf(path, "%s/server%s.pem", cdir, s);
if (stat(path, &sbuf) != 0) {
char *new = NULL;
char *new_name = NULL;
if (create) {
if (inetd || opts_bg) {
set_env("GENCERT_NOPROMPT", "1");
}
new = create_tmp_pem(path, prompt);
new_name = create_tmp_pem(path, prompt);
if (!getenv("X11VNC_SSL_NO_PASSPHRASE") && !inetd && !opts_bg) {
sslEncKey(new, 0);
sslEncKey(new_name, 0);
}
}
return new;
return new_name;
}
if (! quiet) {
......@@ -332,9 +332,12 @@ char *create_tmp_pem(char *pathin, int prompt) {
sprintf(str, tmpl, C, L, OU, O, CN, EM);
cnf_fd = mkstemp(cnf);
if (cnf_fd < 0) {
return NULL;
}
pem_fd = mkstemp(pem);
if (cnf_fd < 0 || pem_fd < 0) {
if (pem_fd < 0) {
close(cnf_fd);
return NULL;
}
......
......@@ -847,15 +847,18 @@ char find_display[] =
"prdpy () {\n"
" d1=$1\n"
" chvt0=\"\"\n"
" if [ \"X$FIND_DISPLAY_NO_VT_FIND\" != \"X\" ]; then\n"
" :\n"
" # we can only do chvt on Linux:\n"
" if [ \"X$uname\" = \"XLinux\" ]; then\n"
" elif [ \"X$uname\" = \"XLinux\" ]; then\n"
" d2=$d1\n"
" d3=`echo \"$d2\" | sed -e 's/^.*:/:/' -e 's/\\..*$//'`\n"
" d4=\"($d2|$d3)\"\n"
"\n"
" # vt is usually in X server line:\n"
" #\n"
" vt=`ps wwwwwaux | grep X | egrep -v 'startx|xinit' | egrep \" $d4 \" | egrep ' vt([789]|[1-9][0-9][0-9]*) ' | grep -v grep | head -n 1`\n"
" ps_tmp=`ps wwaux | grep X`\n"
" vt=`echo \"$ps_tmp\" | grep X | egrep -v 'startx|xinit' | egrep \" $d4 \" | egrep ' vt([789]|[1-9][0-9][0-9]*) ' | grep -v grep | head -n 1`\n"
"\n"
" if [ \"X$vt\" != \"X\" ]; then\n"
" # strip it out and add it.\n"
......@@ -865,7 +868,7 @@ char find_display[] =
" fi\n"
" else\n"
" # otherwise look for tty:\n"
" vt=`ps wwwwwaux | grep X | egrep \" $d4 \" | egrep ' tty([789]|[1-9][0-9][0-9]*) ' | grep -v grep | head -n 1`\n"
" vt=`echo \"$ps_tmp\" | grep X | egrep \" $d4 \" | egrep ' tty([789]|[1-9][0-9][0-9]*) ' | grep -v grep | head -n 1`\n"
" if [ \"X$vt\" != \"X\" ]; then\n"
" vt=`echo \"$vt\" | sed -e 's/^.* tty\\([0-9][0-9]*\\) .*$/\\1/'`\n"
" if echo \"$vt\" | grep '^[0-9][0-9]*$' > /dev/null; then\n"
......@@ -873,8 +876,12 @@ char find_display[] =
" fi\n"
" else\n"
" # otherwise try lsof:\n"
" pvt=`ps wwwwwaux | grep X | egrep -v 'startx|xinit' | egrep \" $d4 \" | head -n 1 | awk '{print $2}'`\n"
" if [ \"X$pvt\" != \"X\" ]; then\n"
" pvt=`echo \"$ps_tmp\" | grep X | egrep -v 'startx|xinit' | egrep \" $d4 \" | head -n 1 | awk '{print $2}'`\n"
" if [ \"X$FIND_DISPLAY_NO_LSOF\" != \"X\" ]; then\n"
" if [ \"X$pvt\" != \"X\" ]; then\n"
" chvt0=\",XPID=$pvt\"\n"
" fi\n"
" elif [ \"X$pvt\" != \"X\" ]; then\n"
" vt=`lsof -b -p \"$pvt\" 2>/dev/null | egrep '/dev/tty([789]|[1-9][0-9][0-9]*)$' | grep -v grep | head -n 1 | awk '{print $NF}' | sed -e 's,/dev/tty,,'`\n"
" if echo \"$vt\" | grep '^[0-9][0-9]*$' > /dev/null; then\n"
" chvt0=\",VT=$vt\"\n"
......@@ -902,9 +909,9 @@ char find_display[] =
"if [ \"X$uname\" = \"XDarwin\" ]; then\n"
" psout=`ps aux 2>/dev/null | grep -wv PID | grep -v grep`\n"
"elif [ \"X$uname\" = \"XLinux\" -o \"X$is_bsd\" = \"X1\" ]; then\n"
" psout=`ps wwwaux 2>/dev/null | grep -wv PID | grep -v grep`\n"
" psout=`ps wwaux 2>/dev/null | grep -wv PID | grep -v grep`\n"
"elif [ \"X$uname\" = \"XSunOS\" -a -x /usr/ucb/ps ]; then\n"
" psout=`/usr/ucb/ps wwwaux 2>/dev/null | grep -wv PID | grep -v grep`\n"
" psout=`/usr/ucb/ps wwaux 2>/dev/null | grep -wv PID | grep -v grep`\n"
"else\n"
" psout=`ps -ef 2>/dev/null | grep -wv PID | grep -v grep`\n"
"fi\n"
......@@ -1192,6 +1199,8 @@ char find_display[] =
"\n"
"# try the items in the list:\n"
"#\n"
"nsout_trim=`echo \"$nsout\" | grep \"/tmp/.X11-unix/\"`\n"
"#\n"
"for p in $list\n"
"do\n"
" xa=`echo \"$p\" | awk -F, '{print $2}'`\n"
......@@ -1205,7 +1214,7 @@ char find_display[] =
" # check for the local X11 files:\n"
" xd=\"/tmp/.X11-unix/X$d\"\n"
" if [ -r \"$xd\" -o -w \"$xd\" -o -x \"$xd\" ]; then\n"
" if echo \"$nsout\" | grep \"/tmp/.X11-unix/X$d[ ]*\\$\" > /dev/null; then\n"
" if echo \"$nsout_trim\" | grep \"/tmp/.X11-unix/X$d[ ]*\\$\" > /dev/null; then\n"
" ok=1\n"
" fi\n"
" fi\n"
......@@ -1473,6 +1482,7 @@ char create_display[] =
"COLUMNS=256\n"
"export COLUMNS\n"
"\n"
"LC_ALL_save=$LC_ALL\n"
"LC_ALL=C\n"
"export LC_ALL\n"
"\n"
......@@ -1491,11 +1501,12 @@ char create_display[] =
" if [ \"X$have_netstat\" != \"X\" ]; then\n"
" nsout=`$have_netstat -an`\n"
" fi\n"
" nsout_trim=`echo \"$nsout\" | grep \"/tmp/.X11-unix/\"`\n"
" while [ $try -lt $sry ]\n"
" do\n"
" tlock=\"/tmp/.X${try}-lock\"\n"
" if [ -r $tlock ]; then\n"
" if echo \"$nsout\" | grep \"/tmp/.X11-unix/X${try}[ ]*\\$\" > /dev/null; then\n"
" if echo \"$nsout_trim\" | grep \"/tmp/.X11-unix/X${try}[ ]*\\$\" > /dev/null; then\n"
" :\n"
" else\n"
" pid=`head -n 1 $tlock 2>/dev/null | sed -e 's/[ ]//g' | grep '^[0-9][0-9]*$'`\n"
......@@ -1513,7 +1524,7 @@ char create_display[] =
" fi\n"
" fi\n"
" if [ ! -f $tlock ]; then\n"
" if echo \"$nsout\" | grep \"/tmp/.X11-unix/X${try}[ ]*\\$\" > /dev/null; then\n"
" if echo \"$nsout_trim\" | grep \"/tmp/.X11-unix/X${try}[ ]*\\$\" > /dev/null; then\n"
" :\n"
" else\n"
" n=$try\n"
......@@ -1829,6 +1840,16 @@ char create_display[] =
" echo \"\" 1>&2\n"
"}\n"
"\n"
"put_back_LC_ALL() {\n"
" if [ \"X$X11VNC_CREATE_LC_ALL_C_OK\" = \"X\" ]; then\n"
" if [ \"X$LC_ALL_save\" = \"X\" ]; then\n"
" unset LC_ALL\n"
" else\n"
" LC_ALL=\"$LC_ALL_save\"\n"
" fi\n"
" fi\n"
"}\n"
"\n"
"server() {\n"
" authfile=`auth`\n"
" sess=`findsession`\n"
......@@ -1894,6 +1915,7 @@ char create_display[] =
" # ns=2\n"
" #fi\n"
"\n"
"\n"
" if [ \"X$use_xdmcp_query\" = \"X1\" ]; then\n"
" # we cannot use -nolisten tcp\n"
" if [ \"X$FD_XDMCP_IF\" != \"X\" ]; then\n"
......@@ -1908,6 +1930,7 @@ char create_display[] =
" lhost=localhost\n"
" fi\n"
" echo \"$* -once -query $lhost $FD_OPTS\" 1>&2\n"
" put_back_LC_ALL\n"
" if [ \"X$have_root\" != \"X\" ]; then\n"
" if [ -r $authfile ]; then\n"
" $have_nohup $* -once -query $lhost -auth $authfile $FD_OPTS 1>&2 &\n"
......@@ -1932,6 +1955,7 @@ char create_display[] =
" sxcmd=$have_startx\n"
" fi\n"
" echo \"$sxcmd $sess -- $* $nolisten -auth $authfile $FD_OPTS\" 1>&2\n"
" put_back_LC_ALL\n"
" if [ \"X$have_root\" != \"X\" ]; then\n"
" $sxcmd $sess -- $* $nolisten -auth $authfile $FD_OPTS 1>&2 &\n"
" else\n"
......@@ -1947,6 +1971,7 @@ char create_display[] =
" else\n"
" # need to emulate startx/xinit ourselves...\n"
" echo \"$* $nolisten -auth $authfile $FD_OPTS\" 1>&2\n"
" put_back_LC_ALL\n"
" if [ \"X$have_root\" != \"X\" ]; then\n"
" $have_nohup $* $nolisten -auth $authfile $FD_OPTS 1>&2 &\n"
" pid=$!\n"
......@@ -1964,10 +1989,14 @@ char create_display[] =
" $have_nohup sh -c \"(sleep 3; $sess)\" 1>&2 &\n"
" fi\n"
" fi\n"
"\n"
" LC_ALL=C\n"
" export LC_ALL\n"
"\n"
" if uname | grep SunOS > /dev/null; then\n"
" $have_nohup sh -c \"(sleep 60; rm -f $rmf)\" 1>&2 &\n"
" $have_nohup sh -c \"(sleep 150; rm -f $rmf)\" 1>&2 &\n"
" else\n"
" $have_nohup sh -c \"(sleep 60; rm -f $rmf $authfile)\" 1>&2 &\n"
" $have_nohup sh -c \"(sleep 150; rm -f $rmf $authfile)\" 1>&2 &\n"
" fi\n"
"\n"
" t=0\n"
......
This diff is collapsed.
......@@ -37,6 +37,7 @@ so, delete this exception statement from your version.
extern int check_uinput(void);
extern int initialize_uinput(void);
extern void shutdown_uinput(void);
extern int set_uinput_accel(char *str);
extern int set_uinput_thresh(char *str);
extern void set_uinput_reset(int ms);
......
......@@ -565,6 +565,12 @@ char *get_pty_ptmx(int *fd_p) {
ioctl(fd, TIOCFLUSH, (char *) 0);
#endif
if (strlen(slave) > sizeof(slave_str)/2) {
rfbLog("get_pty_ptmx: slave string length too long.\n");
close(fd);
return NULL;
}
strcpy(slave_str, slave);
*fd_p = fd;
return slave_str;
......@@ -1743,7 +1749,7 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
down ? "down":"up ", keysym, keystr);
}
if (keysym == XK_Return || keysym == XK_Linefeed) {
if (keysym == XK_Return || keysym == XK_Linefeed || keysym == XK_Tab) {
/* let "up" pass down below for Return case */
if (down) {
return;
......@@ -1866,7 +1872,7 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
return;
}
if (keysym == XK_Return || keysym == XK_Linefeed) {
if (keysym == XK_Return || keysym == XK_Linefeed || keysym == XK_Tab) {
char pw[] = "Password: ";
if (down) {
......
......@@ -2769,6 +2769,7 @@ if (db) fprintf(stderr, "\n");
clean_up_exit(1);
}
n = fread(line2, 1, 16384, p);
pclose(p);
}
if (tmp_fd >= 0) {
unlink(tmp);
......
......@@ -96,8 +96,8 @@ extern struct timeval _mysleep;
((KeySym)(keysym) != XK_Caps_Lock) && ((KeySym)(keysym) != XK_Shift_Lock)))
/*
* Not sure why... but when threaded we have to mutex our X11 calls to
* avoid XIO crashes.
* When threaded we have to mutex our X11 calls to avoid XIO crashes
* due to callbacks.
*/
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
extern MUTEX(x11Mutex);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -133,6 +133,8 @@ so, delete this exception statement from your version.
* -DPOLL_8TO24_DELAY=N
* -DDEBUG_XEVENTS=1 enable printout for X events.
*
* -DX11VNC_MACOSX_USE_GETMAINDEVICE use deprecated GetMainDevice on macosx
*
* Set these in CPPFLAGS before running configure. E.g.:
*
* % env CPPFLAGS="-DFOREVER -DREMOTE_CONTROL=0" ./configure
......
......@@ -47,7 +47,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0;
/* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.9.13 lastmod: 2010-09-10";
char lastmod[] = "0.9.13 lastmod: 2010-12-20";
/* X display info */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment