This is a patch for x0rfbserver-0.1.2 to add an additional option. The
option is to NOT scan the display for updates. This is useful if you
use win2vnc or x2vnc (http://fredrik.hubbe.net/win2vnc.html and 
http://fredrik.hubbe.net/x2vnc.html), where you don't need the image of
the 'remote' screen sent to the client, because the original is right there
on your desk. Without this, x0rfbserver spends a noticable amount of CPU
time making updates that are never sent, and making your system's response
a little jerky in the meantime.

The new option 'disable display updates' is on the second (Update Handling)
tab of the Properties, and is saved and loaded as all the other properties
are.

It also contains a few extra casts which seemed to stop this app compiling
for me on redhat 7.2.

Apply the patch in the x0rfbserver subdirectory.

--- rfb-0.1.2/x0rfbserver/OXProperties.cc	Mon Nov 27 05:22:44 2000
+++ rfb-0.1.2-hj/x0rfbserver/OXProperties.cc	Sat Jan  5 00:22:38 2002
@@ -67,6 +67,9 @@ void readProperties( char *filename, Pro
     if ( !strcasecmp( section, "Update" ) ) {
       if ( iniFile.GetItem( "ShowMousePointer", value ) )
         properties.showMousePointer = atoi( value );
+      if ( iniFile.GetItem( "DisableDisplayUpdate", value ) )
+        properties.disableDisplayUpdate = atoi( value );
+
     }
   }
 }
@@ -78,18 +81,20 @@ void writeProperties( char *filename, Pr
   char tmp[1024];
 
   iniFile.PutNext( "Connection" );
-  iniFile.PutItem( "SocketConnections", properties.acceptSocketConnections? "1":"0" );
+  iniFile.PutItem( "SocketConnections",(char *)(properties.acceptSocketConnections? "1":"0") );
   snprintf( tmp, 1023, "%i", properties.displayNumber );
   iniFile.PutItem( "Display", tmp );
-  iniFile.PutItem( "AutoDisplay", properties.autoDisplayNumber? "1":"0" );
+  iniFile.PutItem( "AutoDisplay", (char *)(properties.autoDisplayNumber? "1":"0") );
   encryptPasswordHex( properties.password, tmp );
   iniFile.PutItem( "Password", tmp );
-  iniFile.PutItem( "DisableRemote", properties.disableRemoteControl? "1":"0" );
-  iniFile.PutItem( "DisableLocal", properties.disableLocalControl? "1":"0" );
+  iniFile.PutItem( "DisableRemote", (char *)(properties.disableRemoteControl? "1":"0") );
+  iniFile.PutItem( "DisableLocal", (char *) (properties.disableLocalControl? "1":"0") );
 
   iniFile.PutNewLine();
   iniFile.PutNext( "Update" );
-  iniFile.PutItem( "ShowMousePointer", properties.showMousePointer? "1":"0" );
+  iniFile.PutItem( "ShowMousePointer", (char *) (properties.showMousePointer? "1":"0") );
+  iniFile.PutItem( "DisableDisplayUpdate", (char *) (properties.disableDisplayUpdate? "1":"0") );
+
 }
 
 
@@ -106,7 +111,9 @@ void OXProperties::ApplySettings()
   properties->disableLocalControl = checkButtonDisableLocalControl->GetState() == BUTTON_DOWN;
 
   properties->showMousePointer = checkButtonShowMousePointer->GetState() == BUTTON_DOWN;
+  properties->disableDisplayUpdate = checkButtonDisableDisplayUpdate->GetState() == BUTTON_DOWN;
   
+
   writeProperties( filename, *properties );
 }
 
@@ -207,6 +214,13 @@ OXProperties::OXProperties( const OXWind
   checkButtonShowMousePointer->SetFont( font );
 
 
+  checkButtonDisableDisplayUpdate
+    = new OXCheckButton( groupUpdateHandling, new OString("Disable Display Update (experimental)"), -1 );
+  ADD_FRAME( groupUpdateHandling, checkButtonDisableDisplayUpdate, ( LHINTS_TOP | LHINTS_LEFT, 12, 0, 8, 0 ) );
+  checkButtonDisableDisplayUpdate->SetFont( font );
+
+
+
   SetDefaultAcceptButton( buttonOK );
   SetDefaultCancelButton( buttonCancel );
 
@@ -230,6 +244,10 @@ OXProperties::OXProperties( const OXWind
   if ( properties->showMousePointer )
     checkButtonShowMousePointer->SetState( BUTTON_DOWN );
 
+  if ( properties->disableDisplayUpdate )
+    checkButtonDisableDisplayUpdate->SetState( BUTTON_DOWN );
+
+
   Layout();
 //  Resize( GetDefaultSize() );
 
--- rfb-0.1.2/x0rfbserver/OXProperties.h	Mon Nov 27 05:09:09 2000
+++ rfb-0.1.2-hj/x0rfbserver/OXProperties.h	Fri Jan  4 22:40:18 2002
@@ -40,6 +40,7 @@ class Properties
           , disableLocalControl( false )
           , disableRemoteControl( false )
           , showMousePointer( true )
+	  , disableDisplayUpdate( false )
         {}
 
         bool acceptSocketConnections;
@@ -49,6 +50,7 @@ class Properties
         bool disableLocalControl;
         bool disableRemoteControl;
         bool showMousePointer;
+	bool disableDisplayUpdate;
 };
 
 
@@ -79,6 +81,8 @@ class OXProperties: public OXTransientFr
         OXCheckButton *checkButtonDisableLocalControl;
 
         OXCheckButton *checkButtonShowMousePointer;
+        OXCheckButton *checkButtonDisableDisplayUpdate;
+
 };
 
 
--- rfb-0.1.2/x0rfbserver/x0rfbserver.cc	Mon Nov 27 09:47:46 2000
+++ rfb-0.1.2-hj/x0rfbserver/x0rfbserver.cc	Sat Jan  5 00:21:35 2002
@@ -101,7 +101,7 @@ class OXServerMainFrame: public OXMainFr
     XUpdateScanner *scanner;
     
     OXServiceApplet *serviceApplet;
-    
+
     map< OFileHandler*, BaseServer* > handleServerMap;
     list< BaseServer* > serverList;
 };
@@ -134,7 +134,7 @@ OXServerMainFrame::OXServerMainFrame( in
     {
       mainFrame = this;
       idle = NULL;
-      
+
       if ( stdio ) {
         serviceApplet = NULL;
 	
@@ -339,7 +339,12 @@ int OXServerMainFrame::HandleIdleEvent( 
   delete ( idle );
   idle = NULL;
   if ( serverList.empty() ) return true;
-  ScanUpdates();
+
+  // HAJ -> this is the bit to make an option!
+  if(!properties.disableDisplayUpdate)
+    {  
+      ScanUpdates();
+    }
   list< BaseServer* >::iterator s;
   for ( s = serverList.begin(); s != serverList.end(); s++ )
     (*s)->sendIncrementalFramebufferUpdate();

