Merge pull request #332 from xiaoshaaming/master

Added missing dependency for Complie error on RHEL7
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 724aa93..a9e7f4e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,8 +104,9 @@
   message(STATUS "32-bit build")
 endif()
 
-# CMake doesn't properly support resource compilation with MinGW.  Boo!
-if(MINGW)
+# Versions of CMake before 2.8.7 do not properly support resource compilation
+# with MinGW.  Boo!
+if(MINGW AND "${CMAKE_VERSION}" VERSION_LESS "2.8.7")
   if(NOT DEFINED RC)
     set(CMAKE_RC_COMPILER_INIT windres)
   else()
diff --git a/common/rfb/CSecurityTLS.cxx b/common/rfb/CSecurityTLS.cxx
index 3dceded..8a053e3 100644
--- a/common/rfb/CSecurityTLS.cxx
+++ b/common/rfb/CSecurityTLS.cxx
@@ -67,21 +67,14 @@
 
 static LogWriter vlog("TLS");
 
-void CSecurityTLS::initGlobal()
-{
-  static bool globalInitDone = false;
-
-  if (!globalInitDone) {
-    gnutls_global_init();
-    globalInitDone = true;
-  }
-}
-
 CSecurityTLS::CSecurityTLS(bool _anon) : session(0), anon_cred(0),
 						 anon(_anon), fis(0), fos(0)
 {
   cafile = X509CA.getData();
   crlfile = X509CRL.getData();
+
+  if (gnutls_global_init() != GNUTLS_E_SUCCESS)
+    throw AuthFailureException("gnutls_global_init failed");
 }
 
 void CSecurityTLS::setDefaults()
@@ -125,8 +118,6 @@
   if (session) {
     gnutls_deinit(session);
     session = 0;
-
-    gnutls_global_deinit();
   }
 }
 
@@ -142,6 +133,8 @@
 
   delete[] cafile;
   delete[] crlfile;
+
+  gnutls_global_deinit();
 }
 
 bool CSecurityTLS::processMsg(CConnection* cc)
@@ -150,8 +143,6 @@
   rdr::OutStream* os = cc->getOutStream();
   client = cc;
 
-  initGlobal();
-
   if (!session) {
     if (!is->checkNoWait(1))
       return false;
diff --git a/common/rfb/CSecurityTLS.h b/common/rfb/CSecurityTLS.h
index b147d80..57d964d 100644
--- a/common/rfb/CSecurityTLS.h
+++ b/common/rfb/CSecurityTLS.h
@@ -62,8 +62,6 @@
     CConnection *client;
 
   private:
-    static void initGlobal();
-
     gnutls_session_t session;
     gnutls_anon_client_credentials_t anon_cred;
     gnutls_certificate_credentials_t cert_cred;
diff --git a/common/rfb/SSecurityTLS.cxx b/common/rfb/SSecurityTLS.cxx
index 0f52d34..b946022 100644
--- a/common/rfb/SSecurityTLS.cxx
+++ b/common/rfb/SSecurityTLS.cxx
@@ -48,23 +48,15 @@
 
 static LogWriter vlog("TLS");
 
-void SSecurityTLS::initGlobal()
-{
-  static bool globalInitDone = false;
-
-  if (!globalInitDone) {
-    if (gnutls_global_init() != GNUTLS_E_SUCCESS)
-      throw AuthFailureException("gnutls_global_init failed");
-    globalInitDone = true;
-  }
-}
-
 SSecurityTLS::SSecurityTLS(bool _anon) : session(0), dh_params(0),
 						 anon_cred(0), cert_cred(0),
 						 anon(_anon), fis(0), fos(0)
 {
   certfile = X509_CertFile.getData();
   keyfile = X509_KeyFile.getData();
+
+  if (gnutls_global_init() != GNUTLS_E_SUCCESS)
+    throw AuthFailureException("gnutls_global_init failed");
 }
 
 void SSecurityTLS::shutdown()
@@ -94,8 +86,6 @@
   if (session) {
     gnutls_deinit(session);
     session = 0;
-
-    gnutls_global_deinit();
   }
 }
 
@@ -111,6 +101,8 @@
 
   delete[] keyfile;
   delete[] certfile;
+
+  gnutls_global_deinit();
 }
 
 bool SSecurityTLS::processMsg(SConnection *sc)
@@ -121,8 +113,6 @@
   vlog.debug("Process security message (session %p)", session);
 
   if (!session) {
-    initGlobal();
-
     if (gnutls_init(&session, GNUTLS_SERVER) != GNUTLS_E_SUCCESS)
       throw AuthFailureException("gnutls_init failed");
 
diff --git a/common/rfb/SSecurityTLS.h b/common/rfb/SSecurityTLS.h
index a793205..30242a2 100644
--- a/common/rfb/SSecurityTLS.h
+++ b/common/rfb/SSecurityTLS.h
@@ -54,8 +54,6 @@
     void setParams(gnutls_session_t session);
 
   private:
-    static void initGlobal();
-
     gnutls_session_t session;
     gnutls_dh_params_t dh_params;
     gnutls_anon_server_credentials_t anon_cred;
diff --git a/contrib/packages/rpm/el6/SPECS/tigervnc.spec b/contrib/packages/rpm/el6/SPECS/tigervnc.spec
index 14f9fea..447eb7f 100644
--- a/contrib/packages/rpm/el6/SPECS/tigervnc.spec
+++ b/contrib/packages/rpm/el6/SPECS/tigervnc.spec
@@ -339,7 +339,7 @@
 	-DJAVA_KEY_ALIAS=%{_key_alias} \
 	-DJAVA_STOREPASS=":env STOREPASS" \
 	-DJAVA_KEYPASS=":env KEYPASS" \
-	-DJAVA_TSA_URL=https://timestamp.geotrust.com/tsa .
+	-DJAVA_TSA_URL=http://timestamp.geotrust.com/tsa .
 %endif
 
 JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8" make
diff --git a/contrib/packages/rpm/el7/SPECS/tigervnc.spec b/contrib/packages/rpm/el7/SPECS/tigervnc.spec
index c440d98..ac58d5b 100644
--- a/contrib/packages/rpm/el7/SPECS/tigervnc.spec
+++ b/contrib/packages/rpm/el7/SPECS/tigervnc.spec
@@ -259,7 +259,7 @@
 	-DJAVA_KEY_ALIAS=%{_key_alias} \
 	-DJAVA_STOREPASS=":env STOREPASS" \
 	-DJAVA_KEYPASS=":env KEYPASS" \
-	-DJAVA_TSA_URL=https://timestamp.geotrust.com/tsa .
+	-DJAVA_TSA_URL=http://timestamp.geotrust.com/tsa .
 %endif
 
 JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8" make
diff --git a/po/nl.po b/po/nl.po
index 37598a8..0c24da1 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -2,13 +2,13 @@
 # Copyright (C) the TigerVNC Team (msgids)
 # This file is distributed under the same license as the tigervnc package.
 #
-# Benno Schulenberg <benno@vertaalt.nl>, 2014, 2015.
+# Benno Schulenberg <benno@vertaalt.nl>, 2014, 2015, 2016.
 msgid ""
 msgstr ""
-"Project-Id-Version: tigervnc 1.5.90\n"
+"Project-Id-Version: tigervnc 1.6.90\n"
 "Report-Msgid-Bugs-To: tigervnc-devel@googlegroups.com\n"
-"POT-Creation-Date: 2015-11-26 11:33+0000\n"
-"PO-Revision-Date: 2015-12-04 21:42+0100\n"
+"POT-Creation-Date: 2016-07-01 10:15+0000\n"
+"PO-Revision-Date: 2016-07-26 11:15+0200\n"
 "Last-Translator: Benno Schulenberg <benno@vertaalt.nl>\n"
 "Language-Team: Dutch <vertaling@vrijschrift.org>\n"
 "Language: nl\n"
@@ -18,108 +18,98 @@
 "X-Generator: Lokalize 1.0\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
-#: vncviewer/CConn.cxx:111
+#: vncviewer/CConn.cxx:110
 #, c-format
 msgid "connected to host %s port %d"
 msgstr "verbonden met host %s poort %d"
 
-#: vncviewer/CConn.cxx:173
+#: vncviewer/CConn.cxx:169
 #, c-format
 msgid "Desktop name: %.80s"
 msgstr "Bureaubladnaam: %.80s"
 
-#: vncviewer/CConn.cxx:178
+#: vncviewer/CConn.cxx:174
 #, c-format
 msgid "Host: %.80s port: %d"
 msgstr "Host: %.80s poort: %d"
 
-#: vncviewer/CConn.cxx:183
+#: vncviewer/CConn.cxx:179
 #, c-format
 msgid "Size: %d x %d"
 msgstr "Grootte: %d x %d"
 
-#: vncviewer/CConn.cxx:191
+#: vncviewer/CConn.cxx:187
 #, c-format
 msgid "Pixel format: %s"
 msgstr "Pixel-indeling: %s"
 
-#: vncviewer/CConn.cxx:198
+#: vncviewer/CConn.cxx:194
 #, c-format
 msgid "(server default %s)"
 msgstr "(serverstandaard is %s)"
 
-#: vncviewer/CConn.cxx:203
+#: vncviewer/CConn.cxx:199
 #, c-format
 msgid "Requested encoding: %s"
 msgstr "Gevraagde codering: %s"
 
-#: vncviewer/CConn.cxx:208
+#: vncviewer/CConn.cxx:204
 #, c-format
 msgid "Last used encoding: %s"
 msgstr "Laatst gebruikte codering: %s"
 
-#: vncviewer/CConn.cxx:213
+#: vncviewer/CConn.cxx:209
 #, c-format
 msgid "Line speed estimate: %d kbit/s"
 msgstr "Geschatte lijnsnelheid: %d kbit/s"
 
-#: vncviewer/CConn.cxx:218
+#: vncviewer/CConn.cxx:214
 #, c-format
 msgid "Protocol version: %d.%d"
 msgstr "Protocolversie: %d.%d"
 
-#: vncviewer/CConn.cxx:223
+#: vncviewer/CConn.cxx:219
 #, c-format
 msgid "Security method: %s"
 msgstr "Beveiligingsmethode: %s"
 
-#: vncviewer/CConn.cxx:329
+#: vncviewer/CConn.cxx:319
 #, c-format
 msgid "SetDesktopSize failed: %d"
 msgstr "### SetDesktopSize is mislukt: %d"
 
-#: vncviewer/CConn.cxx:398
+#: vncviewer/CConn.cxx:411
 msgid "Invalid SetColourMapEntries from server!"
 msgstr "Ongeldige 'SetColourMapEntries' van de server!"
 
-#. TRANSLATORS: Refers to a VNC protocol encoding type
-#: vncviewer/CConn.cxx:444 vncviewer/CConn.cxx:451
-#, c-format
-msgid "Unknown encoding %d"
-msgstr "Onbekende codering %d"
-
-#: vncviewer/CConn.cxx:445 vncviewer/CConn.cxx:452
-msgid "Unknown encoding"
-msgstr "Onbekende codering"
-
-#: vncviewer/CConn.cxx:484
+#: vncviewer/CConn.cxx:485
 msgid "Enabling continuous updates"
 msgstr "Continue updates inschakelen"
 
-#: vncviewer/CConn.cxx:554
+#: vncviewer/CConn.cxx:555
 #, c-format
 msgid "Throughput %d kbit/s - changing to quality %d"
 msgstr "Throughput is %d kbit/s -- overgaand naar kwaliteit %d"
 
-#: vncviewer/CConn.cxx:576
+#: vncviewer/CConn.cxx:577
 #, c-format
 msgid "Throughput %d kbit/s - full color is now %s"
 msgstr "Throughput is %d kbit/s -- volledige kleuren is nu %s"
 
-#: vncviewer/CConn.cxx:578
+#: vncviewer/CConn.cxx:579
 msgid "disabled"
 msgstr "uitgeschakeld"
 
-#: vncviewer/CConn.cxx:578
+#: vncviewer/CConn.cxx:579
 msgid "enabled"
 msgstr "ingeschakeld"
 
-#: vncviewer/CConn.cxx:588
+#: vncviewer/CConn.cxx:589
 #, c-format
 msgid "Using %s encoding"
 msgstr "Codering %s wordt gebruikt"
 
-#: vncviewer/CConn.cxx:635
+#: vncviewer/CConn.cxx:636
 #, c-format
 msgid "Using pixel format %s"
 msgstr "Pixel-indeling %s wordt gebruikt"
@@ -128,25 +118,25 @@
 msgid "Invalid geometry specified!"
 msgstr "Ongeldige afmetingen opgegeven!"
 
-#: vncviewer/DesktopWindow.cxx:309
+#: vncviewer/DesktopWindow.cxx:303
 msgid "Adjusting window size to avoid accidental full screen request"
 msgstr "Venstergrootte wordt aangepast om onbedoeld volledigschermverzoek te vermijden"
 
-#: vncviewer/DesktopWindow.cxx:491 vncviewer/DesktopWindow.cxx:497
-#: vncviewer/DesktopWindow.cxx:510
+#: vncviewer/DesktopWindow.cxx:485 vncviewer/DesktopWindow.cxx:491
+#: vncviewer/DesktopWindow.cxx:504
 msgid "Failure grabbing keyboard"
 msgstr "Het pakken van het toetsenbord is mislukt"
 
-#: vncviewer/DesktopWindow.cxx:522
+#: vncviewer/DesktopWindow.cxx:516
 msgid "Failure grabbing mouse"
 msgstr "Het pakken van de muis is mislukt"
 
-#: vncviewer/DesktopWindow.cxx:752
+#: vncviewer/DesktopWindow.cxx:746
 msgid "Invalid screen layout computed for resize request!"
 msgstr "Ongeldige schermopmaak berekend voor wijzigingsverzoek."
 
 #: vncviewer/FLTKPixelBuffer.cxx:33 vncviewer/OSXPixelBuffer.cxx:48
-#: vncviewer/X11PixelBuffer.cxx:113
+#: vncviewer/X11PixelBuffer.cxx:117
 msgid "Not enough memory for framebuffer"
 msgstr "Onvoldoende geheugen beschikbaar voor framebuffer"
 
@@ -163,160 +153,164 @@
 msgstr "VNC-viewer: Verbindingsopties"
 
 #: vncviewer/OptionsDialog.cxx:83 vncviewer/ServerDialog.cxx:91
-#: vncviewer/vncviewer.cxx:268
+#: vncviewer/vncviewer.cxx:282
 msgid "Cancel"
 msgstr "Annuleren"
 
-#: vncviewer/OptionsDialog.cxx:88 vncviewer/vncviewer.cxx:267
+#: vncviewer/OptionsDialog.cxx:88 vncviewer/vncviewer.cxx:281
 msgid "OK"
 msgstr "OK"
 
-#: vncviewer/OptionsDialog.cxx:413
+#: vncviewer/OptionsDialog.cxx:423
 msgid "Compression"
 msgstr "Compressie"
 
-#: vncviewer/OptionsDialog.cxx:429
+#: vncviewer/OptionsDialog.cxx:439
 msgid "Auto select"
 msgstr "Automatisch selecteren"
 
-#: vncviewer/OptionsDialog.cxx:441
+#: vncviewer/OptionsDialog.cxx:451
 msgid "Preferred encoding"
 msgstr "Voorkeurscodering"
 
-#: vncviewer/OptionsDialog.cxx:489
+#: vncviewer/OptionsDialog.cxx:499
 msgid "Color level"
 msgstr "Kleurdiepte"
 
-#: vncviewer/OptionsDialog.cxx:500
+#: vncviewer/OptionsDialog.cxx:510
 msgid "Full (all available colors)"
 msgstr "volledig (alle beschikbare kleuren)"
 
-#: vncviewer/OptionsDialog.cxx:507
+#: vncviewer/OptionsDialog.cxx:517
 msgid "Medium (256 colors)"
 msgstr "medium (256 kleuren)"
 
-#: vncviewer/OptionsDialog.cxx:514
+#: vncviewer/OptionsDialog.cxx:524
 msgid "Low (64 colors)"
 msgstr "laag (64 kleuren)"
 
-#: vncviewer/OptionsDialog.cxx:521
+#: vncviewer/OptionsDialog.cxx:531
 msgid "Very low (8 colors)"
 msgstr "zeer laag (8 kleuren)"
 
-#: vncviewer/OptionsDialog.cxx:538
+#: vncviewer/OptionsDialog.cxx:548
 msgid "Custom compression level:"
 msgstr "Aangepast compressieniveau:"
 
-#: vncviewer/OptionsDialog.cxx:544
+#: vncviewer/OptionsDialog.cxx:554
 msgid "level (1=fast, 6=best [4-6 are rarely useful])"
 msgstr "niveau (1=snel, 6=best [4-6 zijn zelden nuttig])"
 
-#: vncviewer/OptionsDialog.cxx:551
+#: vncviewer/OptionsDialog.cxx:561
 msgid "Allow JPEG compression:"
 msgstr "JPEG-compressie toestaan:"
 
-#: vncviewer/OptionsDialog.cxx:557
+#: vncviewer/OptionsDialog.cxx:567
 msgid "quality (0=poor, 9=best)"
 msgstr "kwaliteit (0=slecht, 9=best)"
 
-#: vncviewer/OptionsDialog.cxx:568
+#: vncviewer/OptionsDialog.cxx:578
 msgid "Security"
 msgstr "Beveiliging"
 
-#: vncviewer/OptionsDialog.cxx:583
+#: vncviewer/OptionsDialog.cxx:593
 msgid "Encryption"
 msgstr "Versleuteling"
 
-#: vncviewer/OptionsDialog.cxx:594 vncviewer/OptionsDialog.cxx:647
-#: vncviewer/OptionsDialog.cxx:715
+#: vncviewer/OptionsDialog.cxx:604 vncviewer/OptionsDialog.cxx:657
+#: vncviewer/OptionsDialog.cxx:735
 msgid "None"
 msgstr "Geen"
 
-#: vncviewer/OptionsDialog.cxx:600
+#: vncviewer/OptionsDialog.cxx:610
 msgid "TLS with anonymous certificates"
 msgstr "TLS met anonieme certificaten"
 
-#: vncviewer/OptionsDialog.cxx:606
+#: vncviewer/OptionsDialog.cxx:616
 msgid "TLS with X509 certificates"
 msgstr "TLS met X509-certificaten"
 
-#: vncviewer/OptionsDialog.cxx:613
+#: vncviewer/OptionsDialog.cxx:623
 msgid "Path to X509 CA certificate"
 msgstr "Pad naar X509 CA-certificaat"
 
-#: vncviewer/OptionsDialog.cxx:620
+#: vncviewer/OptionsDialog.cxx:630
 msgid "Path to X509 CRL file"
 msgstr "Pad naar X509 CRL-bestand"
 
-#: vncviewer/OptionsDialog.cxx:636
+#: vncviewer/OptionsDialog.cxx:646
 msgid "Authentication"
 msgstr "Authenticatie"
 
-#: vncviewer/OptionsDialog.cxx:653
+#: vncviewer/OptionsDialog.cxx:663
 msgid "Standard VNC (insecure without encryption)"
 msgstr "Standaard VNC (onveilig zonder versleuteling)"
 
-#: vncviewer/OptionsDialog.cxx:659
+#: vncviewer/OptionsDialog.cxx:669
 msgid "Username and password (insecure without encryption)"
 msgstr "Gebruikersnaam en wachtwoord (onveilig zonder versleuteling)"
 
-#: vncviewer/OptionsDialog.cxx:678
+#: vncviewer/OptionsDialog.cxx:688
 msgid "Input"
 msgstr "Invoer"
 
-#: vncviewer/OptionsDialog.cxx:686
+#: vncviewer/OptionsDialog.cxx:696
 msgid "View only (ignore mouse and keyboard)"
 msgstr "Alleen kijken (muis en toetsenbord negeren)"
 
-#: vncviewer/OptionsDialog.cxx:692
+#: vncviewer/OptionsDialog.cxx:702
 msgid "Accept clipboard from server"
 msgstr "Klembord van server accepteren"
 
-#: vncviewer/OptionsDialog.cxx:698
+#: vncviewer/OptionsDialog.cxx:709
+msgid "Also set primary selection"
+msgstr "Ook de hoofdselectie instellen"
+
+#: vncviewer/OptionsDialog.cxx:716
 msgid "Send clipboard to server"
 msgstr "Klembord naar server zenden"
 
-#: vncviewer/OptionsDialog.cxx:704
-msgid "Send primary selection and cut buffer as clipboard"
-msgstr "Hoofdselectie en knipbuffer als klembord verzenden"
+#: vncviewer/OptionsDialog.cxx:723
+msgid "Send primary selection as clipboard"
+msgstr "Hoofdselectie als klembord verzenden"
 
-#: vncviewer/OptionsDialog.cxx:710
+#: vncviewer/OptionsDialog.cxx:730
 msgid "Pass system keys directly to server (full screen)"
 msgstr "Systeemsleutels direct aan server doorgeven (volledigscherm)"
 
-#: vncviewer/OptionsDialog.cxx:713
+#: vncviewer/OptionsDialog.cxx:733
 msgid "Menu key"
 msgstr "Menutoets"
 
-#: vncviewer/OptionsDialog.cxx:729
+#: vncviewer/OptionsDialog.cxx:749
 msgid "Screen"
 msgstr "Scherm"
 
-#: vncviewer/OptionsDialog.cxx:737
+#: vncviewer/OptionsDialog.cxx:757
 msgid "Resize remote session on connect"
 msgstr "Grootte van gindse sessie aanpassen bij verbinden"
 
-#: vncviewer/OptionsDialog.cxx:750
+#: vncviewer/OptionsDialog.cxx:770
 msgid "Resize remote session to the local window"
 msgstr "Gindse sessie aan het lokale venster aanpassen"
 
-#: vncviewer/OptionsDialog.cxx:756
+#: vncviewer/OptionsDialog.cxx:776
 msgid "Full-screen mode"
 msgstr "Volledigscherm-modus"
 
-#: vncviewer/OptionsDialog.cxx:762
+#: vncviewer/OptionsDialog.cxx:782
 msgid "Enable full-screen mode over all monitors"
 msgstr "Volledigscherm-modus over alle beeldschermen inschakelen"
 
-#: vncviewer/OptionsDialog.cxx:771
+#: vncviewer/OptionsDialog.cxx:791
 msgid "Misc."
 msgstr "Overige"
 
-#: vncviewer/OptionsDialog.cxx:779
+#: vncviewer/OptionsDialog.cxx:799
 msgid "Shared (don't disconnect other viewers)"
 msgstr "Gedeeld (verbinding van andere viewers niet verbreken)"
 
-#: vncviewer/OptionsDialog.cxx:785
+#: vncviewer/OptionsDialog.cxx:805
 msgid "Show dot when no cursor"
 msgstr "Punt tonen als er geen cursor is"
 
@@ -368,112 +362,112 @@
 msgid "Username:"
 msgstr "Gebruikersnaam:"
 
-#: vncviewer/Viewport.cxx:433
+#: vncviewer/Viewport.cxx:391
 #, c-format
 msgid "Unable to create platform specific framebuffer: %s"
 msgstr "Kan geen platform-specifiek framebuffer aanmaken: %s"
 
-#: vncviewer/Viewport.cxx:434
+#: vncviewer/Viewport.cxx:392
 msgid "Using platform independent framebuffer"
 msgstr "Platform-onafhankelijk framebuffer wordt gebruikt"
 
-#: vncviewer/Viewport.cxx:668
+#: vncviewer/Viewport.cxx:628
 #, c-format
 msgid "No scan code for extended virtual key 0x%02x"
 msgstr "Geen scancode voor uitgebreide virtuele toets 0x%02x"
 
-#: vncviewer/Viewport.cxx:670
+#: vncviewer/Viewport.cxx:630
 #, c-format
 msgid "No scan code for virtual key 0x%02x"
 msgstr "Geen scancode voor virtuele toets 0x%02x"
 
-#: vncviewer/Viewport.cxx:687
+#: vncviewer/Viewport.cxx:647
 #, c-format
 msgid "No symbol for extended virtual key 0x%02x"
 msgstr "Geen symbool voor uitgebreide virtuele toets 0x%02x"
 
-#: vncviewer/Viewport.cxx:689
+#: vncviewer/Viewport.cxx:649
 #, c-format
 msgid "No symbol for virtual key 0x%02x"
 msgstr "Geen symbool voor virtuele toets 0x%02x"
 
-#: vncviewer/Viewport.cxx:727
+#: vncviewer/Viewport.cxx:687
 #, c-format
 msgid "No symbol for key code 0x%02x (in the current state)"
 msgstr "Geen symbool voor toetscode 0x%02x (in de huidige toestand)"
 
-#: vncviewer/Viewport.cxx:753
+#: vncviewer/Viewport.cxx:713
 #, c-format
 msgid "No symbol for key code %d (in the current state)"
 msgstr "Geen symbool voor toetscode %d (in de huidige toestand)"
 
-#: vncviewer/Viewport.cxx:790
+#: vncviewer/Viewport.cxx:750
 msgctxt "ContextMenu|"
 msgid "E&xit viewer"
 msgstr "Viewer af&sluiten"
 
-#: vncviewer/Viewport.cxx:793
+#: vncviewer/Viewport.cxx:753
 msgctxt "ContextMenu|"
 msgid "&Full screen"
 msgstr "&Volledig scherm"
 
-#: vncviewer/Viewport.cxx:796
+#: vncviewer/Viewport.cxx:756
 msgctxt "ContextMenu|"
 msgid "Minimi&ze"
 msgstr "&Minimaliseren"
 
-#: vncviewer/Viewport.cxx:798
+#: vncviewer/Viewport.cxx:758
 msgctxt "ContextMenu|"
 msgid "Resize &window to session"
 msgstr "Ve&nster aan sessie aanpassen"
 
-#: vncviewer/Viewport.cxx:803
+#: vncviewer/Viewport.cxx:763
 msgctxt "ContextMenu|"
 msgid "&Ctrl"
 msgstr "&Ctrl"
 
-#: vncviewer/Viewport.cxx:806
+#: vncviewer/Viewport.cxx:766
 msgctxt "ContextMenu|"
 msgid "&Alt"
 msgstr "&Alt"
 
-#: vncviewer/Viewport.cxx:812
+#: vncviewer/Viewport.cxx:772
 #, c-format
 msgctxt "ContextMenu|"
 msgid "Send %s"
 msgstr "%s zenden"
 
-#: vncviewer/Viewport.cxx:818
+#: vncviewer/Viewport.cxx:778
 msgctxt "ContextMenu|"
 msgid "Send Ctrl-Alt-&Del"
 msgstr "Ctrl-Alt-&Del zenden"
 
-#: vncviewer/Viewport.cxx:821
+#: vncviewer/Viewport.cxx:781
 msgctxt "ContextMenu|"
 msgid "&Refresh screen"
 msgstr "Sch&erm verversen"
 
-#: vncviewer/Viewport.cxx:824
+#: vncviewer/Viewport.cxx:784
 msgctxt "ContextMenu|"
 msgid "&Options..."
 msgstr "&Opties..."
 
-#: vncviewer/Viewport.cxx:826
+#: vncviewer/Viewport.cxx:786
 msgctxt "ContextMenu|"
 msgid "Connection &info..."
 msgstr "Verbindings&info..."
 
-#: vncviewer/Viewport.cxx:828
+#: vncviewer/Viewport.cxx:788
 msgctxt "ContextMenu|"
 msgid "About &TigerVNC viewer..."
 msgstr "Info over &TigerVNC-viewer..."
 
-#: vncviewer/Viewport.cxx:831
+#: vncviewer/Viewport.cxx:791
 msgctxt "ContextMenu|"
 msgid "Dismiss &menu"
 msgstr "Menu ver&laten"
 
-#: vncviewer/Viewport.cxx:915
+#: vncviewer/Viewport.cxx:875
 msgid "VNC connection info"
 msgstr "VNC-verbindingsinfo"
 
@@ -495,123 +489,123 @@
 
 #. TRANSLATORS: "pixmap" is an X11 concept and may not be suitable
 #. to translate.
-#: vncviewer/X11PixelBuffer.cxx:61
+#: vncviewer/X11PixelBuffer.cxx:65
 msgid "Display lacks pixmap format for default depth"
 msgstr "Scherm heeft geen pixmap-indeling voor standaard kleurdiepte"
 
 #. TRANSLATORS: "pixmap" is an X11 concept and may not be suitable
 #. to translate.
-#: vncviewer/X11PixelBuffer.cxx:72
+#: vncviewer/X11PixelBuffer.cxx:76
 msgid "Couldn't find suitable pixmap format"
 msgstr "Kan geen geschikte pixmap-indeling vinden"
 
-#: vncviewer/X11PixelBuffer.cxx:81
+#: vncviewer/X11PixelBuffer.cxx:85
 msgid "Only true colour displays supported"
 msgstr "Alleen true-color beeldschermen worden ondersteund"
 
-#: vncviewer/X11PixelBuffer.cxx:83
+#: vncviewer/X11PixelBuffer.cxx:87
 #, c-format
 msgid "Using default colormap and visual, TrueColor, depth %d."
 msgstr "Standaard kleurenkaart en visual worden gebruikt, TrueColor, diepte %d."
 
-#: vncviewer/X11PixelBuffer.cxx:109
+#: vncviewer/X11PixelBuffer.cxx:113
 msgid "Could not create framebuffer image"
 msgstr "Kan framebuffer-afbeelding niet aanmaken"
 
-#: vncviewer/parameters.cxx:279 vncviewer/parameters.cxx:313
+#: vncviewer/parameters.cxx:286 vncviewer/parameters.cxx:320
 #, c-format
 msgid "The name of the parameter %s was too large to write to the registry"
 msgstr "De naam van parameter %s is te lang om naar het register te schrijven"
 
-#: vncviewer/parameters.cxx:285 vncviewer/parameters.cxx:292
+#: vncviewer/parameters.cxx:292 vncviewer/parameters.cxx:299
 #, c-format
 msgid "The parameter %s was too large to write to the registry"
 msgstr "Parameter %s is te lang om naar het register te schrijven"
 
-#: vncviewer/parameters.cxx:298 vncviewer/parameters.cxx:319
+#: vncviewer/parameters.cxx:305 vncviewer/parameters.cxx:326
 #, c-format
 msgid "Failed to write parameter %s of type %s to the registry: %ld"
 msgstr "Schrijven van parameter %s van type %s naar het register is mislukt: %ld"
 
-#: vncviewer/parameters.cxx:334 vncviewer/parameters.cxx:373
+#: vncviewer/parameters.cxx:341 vncviewer/parameters.cxx:380
 #, c-format
 msgid "The name of the parameter %s was too large to read from the registry"
 msgstr "De naam van parameter %s is te lang om uit het register te lezen"
 
-#: vncviewer/parameters.cxx:343 vncviewer/parameters.cxx:382
+#: vncviewer/parameters.cxx:350 vncviewer/parameters.cxx:389
 #, c-format
 msgid "Failed to read parameter %s from the registry: %ld"
 msgstr "Lezen van parameter %s uit het register is mislukt: %ld"
 
-#: vncviewer/parameters.cxx:352
+#: vncviewer/parameters.cxx:359
 #, c-format
 msgid "The parameter %s was too large to read from the registry"
 msgstr "Parameter %s is te lang om uit het register te lezen"
 
-#: vncviewer/parameters.cxx:402
+#: vncviewer/parameters.cxx:409
 #, c-format
 msgid "Failed to create registry key: %ld"
 msgstr "Aanmaken registersleutel is mislukt: %ld"
 
-#: vncviewer/parameters.cxx:416 vncviewer/parameters.cxx:465
-#: vncviewer/parameters.cxx:527 vncviewer/parameters.cxx:658
+#: vncviewer/parameters.cxx:423 vncviewer/parameters.cxx:472
+#: vncviewer/parameters.cxx:534 vncviewer/parameters.cxx:665
 #, c-format
 msgid "Unknown parameter type for parameter %s"
 msgstr "Onbekend parametertype voor parameter %s"
 
-#: vncviewer/parameters.cxx:423 vncviewer/parameters.cxx:472
+#: vncviewer/parameters.cxx:430 vncviewer/parameters.cxx:479
 #, c-format
 msgid "Failed to close registry key: %ld"
 msgstr "Sluiten van registersleutel is mislukt: %ld"
 
-#: vncviewer/parameters.cxx:439
+#: vncviewer/parameters.cxx:446
 #, c-format
 msgid "Failed to open registry key: %ld"
 msgstr "Openen van registersleutel is mislukt: %ld"
 
-#: vncviewer/parameters.cxx:496
+#: vncviewer/parameters.cxx:503
 msgid "Failed to write configuration file, can't obtain home directory path."
 msgstr "Schrijven van configuratiebestand is mislukt; kan pad van thuismap niet verkrijgen."
 
-#: vncviewer/parameters.cxx:509
+#: vncviewer/parameters.cxx:516
 #, c-format
 msgid "Failed to write configuration file, can't open %s: %s"
 msgstr "Schrijven van configuratiebestand is mislukt; kan %s niet openen: %s"
 
-#: vncviewer/parameters.cxx:552
+#: vncviewer/parameters.cxx:559
 msgid "Failed to read configuration file, can't obtain home directory path."
 msgstr "Lezen van configuratiebestand is mislukt; kan pad van thuismap niet verkrijgen."
 
-#: vncviewer/parameters.cxx:565
+#: vncviewer/parameters.cxx:572
 #, c-format
 msgid "Failed to read configuration file, can't open %s: %s"
 msgstr "Lezen van configuratiebestand is mislukt; kan %s niet openen: %s"
 
-#: vncviewer/parameters.cxx:578 vncviewer/parameters.cxx:583
-#: vncviewer/parameters.cxx:608 vncviewer/parameters.cxx:621
-#: vncviewer/parameters.cxx:637
+#: vncviewer/parameters.cxx:585 vncviewer/parameters.cxx:590
+#: vncviewer/parameters.cxx:615 vncviewer/parameters.cxx:628
+#: vncviewer/parameters.cxx:644
 #, c-format
 msgid "Failed to read line %d in file %s: %s"
 msgstr "Lezen van regel %d in bestand %s is mislukt: %s"
 
-#: vncviewer/parameters.cxx:584
+#: vncviewer/parameters.cxx:591
 msgid "Line too long"
 msgstr "Regel is te lang"
 
-#: vncviewer/parameters.cxx:591
+#: vncviewer/parameters.cxx:598
 #, c-format
 msgid "Configuration file %s is in an invalid format"
 msgstr "Configuratiebestand %s het een ongeldige opmaak"
 
-#: vncviewer/parameters.cxx:609
+#: vncviewer/parameters.cxx:616
 msgid "Invalid format"
 msgstr "Ongeldige opmaak"
 
-#: vncviewer/parameters.cxx:622 vncviewer/parameters.cxx:638
+#: vncviewer/parameters.cxx:629 vncviewer/parameters.cxx:645
 msgid "Invalid format or too large value"
 msgstr "Ongeldige opmaak of te grote waarde"
 
-#: vncviewer/parameters.cxx:665
+#: vncviewer/parameters.cxx:672
 #, c-format
 msgid "Unknown parameter %s on line %d in file %s"
 msgstr "Onbekende parameter %s op regel %d in bestand %s"
@@ -633,89 +627,95 @@
 msgid "About TigerVNC Viewer"
 msgstr "Info over TigerVNC-viewer"
 
-#: vncviewer/vncviewer.cxx:144 vncviewer/vncviewer.cxx:156
+#: vncviewer/vncviewer.cxx:140
+msgid "Internal FLTK error. Exiting."
+msgstr "Interne FLTK-fout.  Bezig met afsluiten."
+
+#: vncviewer/vncviewer.cxx:158 vncviewer/vncviewer.cxx:170
 #, c-format
 msgid "Error starting new TigerVNC Viewer: %s"
 msgstr "Fout tijdens starten van nieuwe TigerVNC-viewer: %s"
 
-#: vncviewer/vncviewer.cxx:165
+#: vncviewer/vncviewer.cxx:179
 #, c-format
 msgid "Termination signal %d has been received. TigerVNC Viewer will now exit."
 msgstr "Beëindigingssignaal %d werd ontvangen.  TigerVNC-viewer sluit nu af."
 
-#: vncviewer/vncviewer.cxx:257
+#: vncviewer/vncviewer.cxx:271
 msgid "TigerVNC Viewer"
 msgstr "TigerVNC-viewer"
 
-#: vncviewer/vncviewer.cxx:265
+#: vncviewer/vncviewer.cxx:279
 msgid "No"
 msgstr "Nee"
 
-#: vncviewer/vncviewer.cxx:266
+#: vncviewer/vncviewer.cxx:280
 msgid "Yes"
 msgstr "Ja"
 
-#: vncviewer/vncviewer.cxx:269
+#: vncviewer/vncviewer.cxx:283
 msgid "Close"
 msgstr "Sluiten"
 
-#: vncviewer/vncviewer.cxx:274
+#: vncviewer/vncviewer.cxx:288
 msgid "About"
 msgstr "Info"
 
-#: vncviewer/vncviewer.cxx:277
+#: vncviewer/vncviewer.cxx:291
 msgid "Hide"
 msgstr "Verbergen"
 
-#: vncviewer/vncviewer.cxx:280
+#: vncviewer/vncviewer.cxx:294
 msgid "Quit"
 msgstr "Afsluiten"
 
-#: vncviewer/vncviewer.cxx:284
+#: vncviewer/vncviewer.cxx:298
 msgid "Services"
 msgstr "Diensten"
 
-#: vncviewer/vncviewer.cxx:285
+#: vncviewer/vncviewer.cxx:299
 msgid "Hide Others"
 msgstr "Andere verbergen"
 
-#: vncviewer/vncviewer.cxx:286
+#: vncviewer/vncviewer.cxx:300
 msgid "Show All"
 msgstr "Alles tonen"
 
-#: vncviewer/vncviewer.cxx:295
+#: vncviewer/vncviewer.cxx:309
 msgctxt "SysMenu|"
 msgid "&File"
 msgstr "&Bestand"
 
-#: vncviewer/vncviewer.cxx:298
+#: vncviewer/vncviewer.cxx:312
 msgctxt "SysMenu|File|"
 msgid "&New Connection"
 msgstr "&Nieuwe verbinding"
 
-#: vncviewer/vncviewer.cxx:310
+#: vncviewer/vncviewer.cxx:324
 msgid "Could not create VNC home directory: can't obtain home directory path."
 msgstr "Kan de VNC-thuismap niet aanmaken: kan pad van thuismap niet verkrijgen."
 
-#: vncviewer/vncviewer.cxx:315
+#: vncviewer/vncviewer.cxx:329
 #, c-format
 msgid "Could not create VNC home directory: %s."
 msgstr "Kan de VNC-thuismap niet aanmaken: %s."
 
 #. TRANSLATORS: "Parameters" are command line arguments, or settings
 #. from a file or the Windows registry.
-#: vncviewer/vncviewer.cxx:520 vncviewer/vncviewer.cxx:521
+#: vncviewer/vncviewer.cxx:534 vncviewer/vncviewer.cxx:535
 msgid "Parameters -listen and -via are incompatible"
 msgstr "de opties '-listen' en '-via' gaan niet samen"
 
-#: vncviewer/vncviewer.cxx:536
+#: vncviewer/vncviewer.cxx:550
 #, c-format
 msgid "Listening on port %d"
 msgstr "Luisterend op poort %d"
 
-#: vncviewer/vncviewer.cxx:601
-msgid "Internal FLTK error. Exiting."
-msgstr "Interne FLTK-fout.  Bezig met afsluiten."
+#~ msgid "Unknown encoding %d"
+#~ msgstr "Onbekende codering %d"
+
+#~ msgid "Unknown encoding"
+#~ msgstr "Onbekende codering"
 
 #~ msgid "Bad Name/Value pair on line: %d in file: %s"
 #~ msgstr "Ongeldig naam-waardepaar op regel %d in bestand %s"
diff --git a/po/sr.po b/po/sr.po
index 6768e6b..b452195 100644
--- a/po/sr.po
+++ b/po/sr.po
@@ -1,13 +1,13 @@
 # Serbian translation for tigervnc.
-# Copyright © 2015 the TigerVNC Team (msgids)
+# Copyright © 2016 the TigerVNC Team (msgids)
 # This file is distributed under the same license as the tigervnc package.
 # Мирослав Николић <miroslavnikolic@rocketmail.com>, 2016.
 msgid ""
 msgstr ""
-"Project-Id-Version: tigervnc-1.5.90\n"
+"Project-Id-Version: tigervnc-1.6.90\n"
 "Report-Msgid-Bugs-To: tigervnc-devel@googlegroups.com\n"
-"POT-Creation-Date: 2015-11-26 11:33+0000\n"
-"PO-Revision-Date: 2016-03-06 15:42+0200\n"
+"POT-Creation-Date: 2016-07-01 10:15+0000\n"
+"PO-Revision-Date: 2016-08-07 21:27+0200\n"
 "Last-Translator: Мирослав Николић <miroslavnikolic@rocketmail.com>\n"
 "Language-Team: Serbian <(nothing)>\n"
 "Language: sr\n"
@@ -16,108 +16,98 @@
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
 
-#: vncviewer/CConn.cxx:111
+#: vncviewer/CConn.cxx:110
 #, c-format
 msgid "connected to host %s port %d"
 msgstr "повезан сам са домаћином „%s“ прикључник %d"
 
-#: vncviewer/CConn.cxx:173
+#: vncviewer/CConn.cxx:169
 #, c-format
 msgid "Desktop name: %.80s"
 msgstr "Назив радне површи: %.80s"
 
-#: vncviewer/CConn.cxx:178
+#: vncviewer/CConn.cxx:174
 #, c-format
 msgid "Host: %.80s port: %d"
 msgstr "Домаћин: %.80s прикључник: %d"
 
-#: vncviewer/CConn.cxx:183
+#: vncviewer/CConn.cxx:179
 #, c-format
 msgid "Size: %d x %d"
 msgstr "Величина: %d x %d"
 
-#: vncviewer/CConn.cxx:191
+#: vncviewer/CConn.cxx:187
 #, c-format
 msgid "Pixel format: %s"
 msgstr "Формат пиксела: %s"
 
-#: vncviewer/CConn.cxx:198
+#: vncviewer/CConn.cxx:194
 #, c-format
 msgid "(server default %s)"
 msgstr "(основно на серверу %s)"
 
-#: vncviewer/CConn.cxx:203
+#: vncviewer/CConn.cxx:199
 #, c-format
 msgid "Requested encoding: %s"
 msgstr "Затражено кодирање: %s"
 
-#: vncviewer/CConn.cxx:208
+#: vncviewer/CConn.cxx:204
 #, c-format
 msgid "Last used encoding: %s"
 msgstr "Последње коришћено кодирање: %s"
 
-#: vncviewer/CConn.cxx:213
+#: vncviewer/CConn.cxx:209
 #, c-format
 msgid "Line speed estimate: %d kbit/s"
 msgstr "Процењена брзина линије: %d kbit/s"
 
-#: vncviewer/CConn.cxx:218
+#: vncviewer/CConn.cxx:214
 #, c-format
 msgid "Protocol version: %d.%d"
 msgstr "Издања протокола: %d.%d"
 
-#: vncviewer/CConn.cxx:223
+#: vncviewer/CConn.cxx:219
 #, c-format
 msgid "Security method: %s"
 msgstr "Метод безбедности: %s"
 
-#: vncviewer/CConn.cxx:329
+#: vncviewer/CConn.cxx:319
 #, c-format
 msgid "SetDesktopSize failed: %d"
 msgstr "Неуспело подешавање величине радне површи: %d"
 
-#: vncviewer/CConn.cxx:398
+#: vncviewer/CConn.cxx:411
 msgid "Invalid SetColourMapEntries from server!"
 msgstr "Неисправни уноси подешавања мапе боје са сервера!"
 
-#. TRANSLATORS: Refers to a VNC protocol encoding type
-#: vncviewer/CConn.cxx:444 vncviewer/CConn.cxx:451
-#, c-format
-msgid "Unknown encoding %d"
-msgstr "Непознато кодирање „%d“"
-
-#: vncviewer/CConn.cxx:445 vncviewer/CConn.cxx:452
-msgid "Unknown encoding"
-msgstr "Непознато кодирање"
-
-#: vncviewer/CConn.cxx:484
+#: vncviewer/CConn.cxx:485
 msgid "Enabling continuous updates"
 msgstr "Укључујем непрекидно освежавање"
 
-#: vncviewer/CConn.cxx:554
+#: vncviewer/CConn.cxx:555
 #, c-format
 msgid "Throughput %d kbit/s - changing to quality %d"
 msgstr "Пропусност је %d kbit/s — мењам на квалитет %d"
 
-#: vncviewer/CConn.cxx:576
+#: vncviewer/CConn.cxx:577
 #, c-format
 msgid "Throughput %d kbit/s - full color is now %s"
 msgstr "Пропусност је %d kbit/s — пуна боја је сада %s"
 
-#: vncviewer/CConn.cxx:578
+#: vncviewer/CConn.cxx:579
 msgid "disabled"
 msgstr "искључена"
 
-#: vncviewer/CConn.cxx:578
+#: vncviewer/CConn.cxx:579
 msgid "enabled"
 msgstr "укључена"
 
-#: vncviewer/CConn.cxx:588
+#: vncviewer/CConn.cxx:589
 #, c-format
 msgid "Using %s encoding"
 msgstr "Користим „%s“ кодирање"
 
-#: vncviewer/CConn.cxx:635
+#: vncviewer/CConn.cxx:636
 #, c-format
 msgid "Using pixel format %s"
 msgstr "Користим формат пиксела %s"
@@ -126,25 +116,25 @@
 msgid "Invalid geometry specified!"
 msgstr "Наведена је неисправна геометрија!"
 
-#: vncviewer/DesktopWindow.cxx:309
+#: vncviewer/DesktopWindow.cxx:303
 msgid "Adjusting window size to avoid accidental full screen request"
 msgstr "Прилагођавам величину прозора да би се избегли случајни захтеви за целим екраном"
 
-#: vncviewer/DesktopWindow.cxx:491 vncviewer/DesktopWindow.cxx:497
-#: vncviewer/DesktopWindow.cxx:510
+#: vncviewer/DesktopWindow.cxx:485 vncviewer/DesktopWindow.cxx:491
+#: vncviewer/DesktopWindow.cxx:504
 msgid "Failure grabbing keyboard"
 msgstr "Неуспех хватања тастатуре"
 
-#: vncviewer/DesktopWindow.cxx:522
+#: vncviewer/DesktopWindow.cxx:516
 msgid "Failure grabbing mouse"
 msgstr "Неуспех хватања миша"
 
-#: vncviewer/DesktopWindow.cxx:752
+#: vncviewer/DesktopWindow.cxx:746
 msgid "Invalid screen layout computed for resize request!"
 msgstr "Прорачунат је неодговарајући распоред екрана за захтев промене величине!"
 
 #: vncviewer/FLTKPixelBuffer.cxx:33 vncviewer/OSXPixelBuffer.cxx:48
-#: vncviewer/X11PixelBuffer.cxx:113
+#: vncviewer/X11PixelBuffer.cxx:117
 msgid "Not enough memory for framebuffer"
 msgstr "Нема довољно меморије за међумеморију кадра"
 
@@ -161,160 +151,164 @@
 msgstr "ВНЦ прегледач: Могућности повезивања"
 
 #: vncviewer/OptionsDialog.cxx:83 vncviewer/ServerDialog.cxx:91
-#: vncviewer/vncviewer.cxx:268
+#: vncviewer/vncviewer.cxx:282
 msgid "Cancel"
 msgstr "Откажи"
 
-#: vncviewer/OptionsDialog.cxx:88 vncviewer/vncviewer.cxx:267
+#: vncviewer/OptionsDialog.cxx:88 vncviewer/vncviewer.cxx:281
 msgid "OK"
 msgstr "У реду"
 
-#: vncviewer/OptionsDialog.cxx:413
+#: vncviewer/OptionsDialog.cxx:423
 msgid "Compression"
 msgstr "Сажимање"
 
-#: vncviewer/OptionsDialog.cxx:429
+#: vncviewer/OptionsDialog.cxx:439
 msgid "Auto select"
 msgstr "Сам изабери"
 
-#: vncviewer/OptionsDialog.cxx:441
+#: vncviewer/OptionsDialog.cxx:451
 msgid "Preferred encoding"
 msgstr "Жељено кодирање"
 
-#: vncviewer/OptionsDialog.cxx:489
+#: vncviewer/OptionsDialog.cxx:499
 msgid "Color level"
 msgstr "Ниво боје"
 
-#: vncviewer/OptionsDialog.cxx:500
+#: vncviewer/OptionsDialog.cxx:510
 msgid "Full (all available colors)"
 msgstr "Пун (све доступне боје)"
 
-#: vncviewer/OptionsDialog.cxx:507
+#: vncviewer/OptionsDialog.cxx:517
 msgid "Medium (256 colors)"
 msgstr "Средњи (256 боја)"
 
-#: vncviewer/OptionsDialog.cxx:514
+#: vncviewer/OptionsDialog.cxx:524
 msgid "Low (64 colors)"
 msgstr "Низак (64 боје)"
 
-#: vncviewer/OptionsDialog.cxx:521
+#: vncviewer/OptionsDialog.cxx:531
 msgid "Very low (8 colors)"
 msgstr "Врло низак (8 боје)"
 
-#: vncviewer/OptionsDialog.cxx:538
+#: vncviewer/OptionsDialog.cxx:548
 msgid "Custom compression level:"
 msgstr "Произвољни ниво сажимања:"
 
-#: vncviewer/OptionsDialog.cxx:544
+#: vncviewer/OptionsDialog.cxx:554
 msgid "level (1=fast, 6=best [4-6 are rarely useful])"
 msgstr "ниво (1=брзо, 6=најбоље [4-6 се ретко користи])"
 
-#: vncviewer/OptionsDialog.cxx:551
+#: vncviewer/OptionsDialog.cxx:561
 msgid "Allow JPEG compression:"
 msgstr "Дозволи ЈПЕГ сажимање:"
 
-#: vncviewer/OptionsDialog.cxx:557
+#: vncviewer/OptionsDialog.cxx:567
 msgid "quality (0=poor, 9=best)"
 msgstr "квалитет (0=лош, 9=најбољи)"
 
-#: vncviewer/OptionsDialog.cxx:568
+#: vncviewer/OptionsDialog.cxx:578
 msgid "Security"
 msgstr "Безбедност"
 
-#: vncviewer/OptionsDialog.cxx:583
+#: vncviewer/OptionsDialog.cxx:593
 msgid "Encryption"
 msgstr "Шифровање"
 
-#: vncviewer/OptionsDialog.cxx:594 vncviewer/OptionsDialog.cxx:647
-#: vncviewer/OptionsDialog.cxx:715
+#: vncviewer/OptionsDialog.cxx:604 vncviewer/OptionsDialog.cxx:657
+#: vncviewer/OptionsDialog.cxx:735
 msgid "None"
 msgstr "Ништа"
 
-#: vncviewer/OptionsDialog.cxx:600
+#: vncviewer/OptionsDialog.cxx:610
 msgid "TLS with anonymous certificates"
 msgstr "ТЛС са анонимним уверењима"
 
-#: vncviewer/OptionsDialog.cxx:606
+#: vncviewer/OptionsDialog.cxx:616
 msgid "TLS with X509 certificates"
 msgstr "ТЛС са X509 уверењима"
 
-#: vncviewer/OptionsDialog.cxx:613
+#: vncviewer/OptionsDialog.cxx:623
 msgid "Path to X509 CA certificate"
 msgstr "Путања до X509 уверења"
 
-#: vncviewer/OptionsDialog.cxx:620
+#: vncviewer/OptionsDialog.cxx:630
 msgid "Path to X509 CRL file"
 msgstr "Путања до X509 ЦРЛ датотеке"
 
-#: vncviewer/OptionsDialog.cxx:636
+#: vncviewer/OptionsDialog.cxx:646
 msgid "Authentication"
 msgstr "Потврђивање идентитета"
 
-#: vncviewer/OptionsDialog.cxx:653
+#: vncviewer/OptionsDialog.cxx:663
 msgid "Standard VNC (insecure without encryption)"
 msgstr "Стандардни ВНЦ (несигурно без шифровања)"
 
-#: vncviewer/OptionsDialog.cxx:659
+#: vncviewer/OptionsDialog.cxx:669
 msgid "Username and password (insecure without encryption)"
 msgstr "Корисник и лозинка (несигурно без шифровања)"
 
-#: vncviewer/OptionsDialog.cxx:678
+#: vncviewer/OptionsDialog.cxx:688
 msgid "Input"
 msgstr "Улаз"
 
-#: vncviewer/OptionsDialog.cxx:686
+#: vncviewer/OptionsDialog.cxx:696
 msgid "View only (ignore mouse and keyboard)"
 msgstr "Само преглед (занемари миша и тастатуру)"
 
-#: vncviewer/OptionsDialog.cxx:692
+#: vncviewer/OptionsDialog.cxx:702
 msgid "Accept clipboard from server"
 msgstr "Прихвати оставу са сервера"
 
-#: vncviewer/OptionsDialog.cxx:698
+#: vncviewer/OptionsDialog.cxx:709
+msgid "Also set primary selection"
+msgstr "Такође постави први избор"
+
+#: vncviewer/OptionsDialog.cxx:716
 msgid "Send clipboard to server"
 msgstr "Пошаљи оставу на сервер"
 
-#: vncviewer/OptionsDialog.cxx:704
-msgid "Send primary selection and cut buffer as clipboard"
-msgstr "Пошаљи први избор и исеци међумеморију као оставу"
+#: vncviewer/OptionsDialog.cxx:723
+msgid "Send primary selection as clipboard"
+msgstr "Пошаљи први избор као оставу"
 
-#: vncviewer/OptionsDialog.cxx:710
+#: vncviewer/OptionsDialog.cxx:730
 msgid "Pass system keys directly to server (full screen)"
 msgstr "Проследи системске кључеве директно на сервер (пун екран)"
 
-#: vncviewer/OptionsDialog.cxx:713
+#: vncviewer/OptionsDialog.cxx:733
 msgid "Menu key"
 msgstr "Тастер изборника"
 
-#: vncviewer/OptionsDialog.cxx:729
+#: vncviewer/OptionsDialog.cxx:749
 msgid "Screen"
 msgstr "Екран"
 
-#: vncviewer/OptionsDialog.cxx:737
+#: vncviewer/OptionsDialog.cxx:757
 msgid "Resize remote session on connect"
 msgstr "Промени величину удаљене сесије приликом повезивања"
 
-#: vncviewer/OptionsDialog.cxx:750
+#: vncviewer/OptionsDialog.cxx:770
 msgid "Resize remote session to the local window"
 msgstr "Промени величину удаљене сесије на месни прозор"
 
-#: vncviewer/OptionsDialog.cxx:756
+#: vncviewer/OptionsDialog.cxx:776
 msgid "Full-screen mode"
 msgstr "Режим пуног екрана"
 
-#: vncviewer/OptionsDialog.cxx:762
+#: vncviewer/OptionsDialog.cxx:782
 msgid "Enable full-screen mode over all monitors"
 msgstr "Укључи режим преко целог екрана на свим мониторима"
 
-#: vncviewer/OptionsDialog.cxx:771
+#: vncviewer/OptionsDialog.cxx:791
 msgid "Misc."
 msgstr "Разно"
 
-#: vncviewer/OptionsDialog.cxx:779
+#: vncviewer/OptionsDialog.cxx:799
 msgid "Shared (don't disconnect other viewers)"
 msgstr "Дељено (не прекидај везу другим прегледачима)"
 
-#: vncviewer/OptionsDialog.cxx:785
+#: vncviewer/OptionsDialog.cxx:805
 msgid "Show dot when no cursor"
 msgstr "Прикажи тачку када нема курзора"
 
@@ -366,112 +360,112 @@
 msgid "Username:"
 msgstr "Корисник:"
 
-#: vncviewer/Viewport.cxx:433
+#: vncviewer/Viewport.cxx:391
 #, c-format
 msgid "Unable to create platform specific framebuffer: %s"
 msgstr "Не могу да направим међумеморију кадра особену за платформу: %s"
 
-#: vncviewer/Viewport.cxx:434
+#: vncviewer/Viewport.cxx:392
 msgid "Using platform independent framebuffer"
 msgstr "Користим међумеморију кадра независну од платформе"
 
-#: vncviewer/Viewport.cxx:668
+#: vncviewer/Viewport.cxx:628
 #, c-format
 msgid "No scan code for extended virtual key 0x%02x"
 msgstr "Нема шифре прегледа за проширени виртуелни кључ 0x%02x"
 
-#: vncviewer/Viewport.cxx:670
+#: vncviewer/Viewport.cxx:630
 #, c-format
 msgid "No scan code for virtual key 0x%02x"
 msgstr "Нема шифре прегледа за виртуелни кључ 0x%02x"
 
-#: vncviewer/Viewport.cxx:687
+#: vncviewer/Viewport.cxx:647
 #, c-format
 msgid "No symbol for extended virtual key 0x%02x"
 msgstr "Нема симбола за проширени виртуелни кључ 0x%02x"
 
-#: vncviewer/Viewport.cxx:689
+#: vncviewer/Viewport.cxx:649
 #, c-format
 msgid "No symbol for virtual key 0x%02x"
 msgstr "Нема симбола за виртуелни кључ 0x%02x"
 
-#: vncviewer/Viewport.cxx:727
+#: vncviewer/Viewport.cxx:687
 #, c-format
 msgid "No symbol for key code 0x%02x (in the current state)"
 msgstr "Нема симбола за шифру кључа 0x%02x (у текућем стању)"
 
-#: vncviewer/Viewport.cxx:753
+#: vncviewer/Viewport.cxx:713
 #, c-format
 msgid "No symbol for key code %d (in the current state)"
 msgstr "Нема симбола за шифру кључа %d (у текућем стању)"
 
-#: vncviewer/Viewport.cxx:790
+#: vncviewer/Viewport.cxx:750
 msgctxt "ContextMenu|"
 msgid "E&xit viewer"
 msgstr "&Напусти прегледача"
 
-#: vncviewer/Viewport.cxx:793
+#: vncviewer/Viewport.cxx:753
 msgctxt "ContextMenu|"
 msgid "&Full screen"
 msgstr "&Пун екран"
 
-#: vncviewer/Viewport.cxx:796
+#: vncviewer/Viewport.cxx:756
 msgctxt "ContextMenu|"
 msgid "Minimi&ze"
 msgstr "&Умањи"
 
-#: vncviewer/Viewport.cxx:798
+#: vncviewer/Viewport.cxx:758
 msgctxt "ContextMenu|"
 msgid "Resize &window to session"
 msgstr "&Величина прозора на сесију"
 
-#: vncviewer/Viewport.cxx:803
+#: vncviewer/Viewport.cxx:763
 msgctxt "ContextMenu|"
 msgid "&Ctrl"
 msgstr "&Ктрл"
 
-#: vncviewer/Viewport.cxx:806
+#: vncviewer/Viewport.cxx:766
 msgctxt "ContextMenu|"
 msgid "&Alt"
 msgstr "&Алт"
 
-#: vncviewer/Viewport.cxx:812
+#: vncviewer/Viewport.cxx:772
 #, c-format
 msgctxt "ContextMenu|"
 msgid "Send %s"
 msgstr "Пошаљи „%s“"
 
-#: vncviewer/Viewport.cxx:818
+#: vncviewer/Viewport.cxx:778
 msgctxt "ContextMenu|"
 msgid "Send Ctrl-Alt-&Del"
 msgstr "Пошаљи Ктрл-Алт-&Дел"
 
-#: vncviewer/Viewport.cxx:821
+#: vncviewer/Viewport.cxx:781
 msgctxt "ContextMenu|"
 msgid "&Refresh screen"
 msgstr "&Освежи екран"
 
-#: vncviewer/Viewport.cxx:824
+#: vncviewer/Viewport.cxx:784
 msgctxt "ContextMenu|"
 msgid "&Options..."
 msgstr "&Могућности..."
 
-#: vncviewer/Viewport.cxx:826
+#: vncviewer/Viewport.cxx:786
 msgctxt "ContextMenu|"
 msgid "Connection &info..."
 msgstr "Подаци о &вези..."
 
-#: vncviewer/Viewport.cxx:828
+#: vncviewer/Viewport.cxx:788
 msgctxt "ContextMenu|"
 msgid "About &TigerVNC viewer..."
 msgstr "О &програму..."
 
-#: vncviewer/Viewport.cxx:831
+#: vncviewer/Viewport.cxx:791
 msgctxt "ContextMenu|"
 msgid "Dismiss &menu"
 msgstr "Одбаци &изборник"
 
-#: vncviewer/Viewport.cxx:915
+#: vncviewer/Viewport.cxx:875
 msgid "VNC connection info"
 msgstr "Подаци о ВНЦ вези"
 
@@ -493,123 +487,123 @@
 
 #. TRANSLATORS: "pixmap" is an X11 concept and may not be suitable
 #. to translate.
-#: vncviewer/X11PixelBuffer.cxx:61
+#: vncviewer/X11PixelBuffer.cxx:65
 msgid "Display lacks pixmap format for default depth"
 msgstr "Приказу недостаје формат пиксмапе за основну дубину"
 
 #. TRANSLATORS: "pixmap" is an X11 concept and may not be suitable
 #. to translate.
-#: vncviewer/X11PixelBuffer.cxx:72
+#: vncviewer/X11PixelBuffer.cxx:76
 msgid "Couldn't find suitable pixmap format"
 msgstr "Не могу да нађем погодан формат пиксмапе"
 
-#: vncviewer/X11PixelBuffer.cxx:81
+#: vncviewer/X11PixelBuffer.cxx:85
 msgid "Only true colour displays supported"
 msgstr "Само прикази праве боје су подржани"
 
-#: vncviewer/X11PixelBuffer.cxx:83
+#: vncviewer/X11PixelBuffer.cxx:87
 #, c-format
 msgid "Using default colormap and visual, TrueColor, depth %d."
 msgstr "Користим основну мапу боје и видности, Права боја, дубине %d."
 
-#: vncviewer/X11PixelBuffer.cxx:109
+#: vncviewer/X11PixelBuffer.cxx:113
 msgid "Could not create framebuffer image"
 msgstr "Не могу да направим слику међумеморије кадра"
 
-#: vncviewer/parameters.cxx:279 vncviewer/parameters.cxx:313
+#: vncviewer/parameters.cxx:286 vncviewer/parameters.cxx:320
 #, c-format
 msgid "The name of the parameter %s was too large to write to the registry"
 msgstr "Назив параметра „%s“ беше превелик за уписивање у регистар"
 
-#: vncviewer/parameters.cxx:285 vncviewer/parameters.cxx:292
+#: vncviewer/parameters.cxx:292 vncviewer/parameters.cxx:299
 #, c-format
 msgid "The parameter %s was too large to write to the registry"
 msgstr "Параметар „%s“ беше превелик за уписивање у регистар"
 
-#: vncviewer/parameters.cxx:298 vncviewer/parameters.cxx:319
+#: vncviewer/parameters.cxx:305 vncviewer/parameters.cxx:326
 #, c-format
 msgid "Failed to write parameter %s of type %s to the registry: %ld"
 msgstr "Нисам успео да упишем параметар „%s“ врсте „%s“ у регистар: %ld"
 
-#: vncviewer/parameters.cxx:334 vncviewer/parameters.cxx:373
+#: vncviewer/parameters.cxx:341 vncviewer/parameters.cxx:380
 #, c-format
 msgid "The name of the parameter %s was too large to read from the registry"
 msgstr "Назив параметра „%s“ беше превелик за читање из регистра"
 
-#: vncviewer/parameters.cxx:343 vncviewer/parameters.cxx:382
+#: vncviewer/parameters.cxx:350 vncviewer/parameters.cxx:389
 #, c-format
 msgid "Failed to read parameter %s from the registry: %ld"
 msgstr "Нисам успео да прочитам параметар „%s“ из регистра: %ld"
 
-#: vncviewer/parameters.cxx:352
+#: vncviewer/parameters.cxx:359
 #, c-format
 msgid "The parameter %s was too large to read from the registry"
 msgstr "Параметар „%s“ беше превелик за читање из регистра"
 
-#: vncviewer/parameters.cxx:402
+#: vncviewer/parameters.cxx:409
 #, c-format
 msgid "Failed to create registry key: %ld"
 msgstr "Нисам успео да направим кључ регистра: %ld"
 
-#: vncviewer/parameters.cxx:416 vncviewer/parameters.cxx:465
-#: vncviewer/parameters.cxx:527 vncviewer/parameters.cxx:658
+#: vncviewer/parameters.cxx:423 vncviewer/parameters.cxx:472
+#: vncviewer/parameters.cxx:534 vncviewer/parameters.cxx:665
 #, c-format
 msgid "Unknown parameter type for parameter %s"
 msgstr "Непозната врста параметра за параметар „%s“"
 
-#: vncviewer/parameters.cxx:423 vncviewer/parameters.cxx:472
+#: vncviewer/parameters.cxx:430 vncviewer/parameters.cxx:479
 #, c-format
 msgid "Failed to close registry key: %ld"
 msgstr "Нисам успео да затворим кључ регистра: %ld"
 
-#: vncviewer/parameters.cxx:439
+#: vncviewer/parameters.cxx:446
 #, c-format
 msgid "Failed to open registry key: %ld"
 msgstr "Нисам успео да отворим кључ регистра: %ld"
 
-#: vncviewer/parameters.cxx:496
+#: vncviewer/parameters.cxx:503
 msgid "Failed to write configuration file, can't obtain home directory path."
 msgstr "Нисам успео да упишем датотеку подешавања, не могу да добијем путању личне фасцикле."
 
-#: vncviewer/parameters.cxx:509
+#: vncviewer/parameters.cxx:516
 #, c-format
 msgid "Failed to write configuration file, can't open %s: %s"
 msgstr "Нисам успео да упишем датотеку подешавања, не могу да отворим „%s“: %s"
 
-#: vncviewer/parameters.cxx:552
+#: vncviewer/parameters.cxx:559
 msgid "Failed to read configuration file, can't obtain home directory path."
 msgstr "Нисам успео да прочитам датотеку подешавања, не могу да добијем путању личне фасцикле."
 
-#: vncviewer/parameters.cxx:565
+#: vncviewer/parameters.cxx:572
 #, c-format
 msgid "Failed to read configuration file, can't open %s: %s"
 msgstr "Нисам успео да прочитам датотеку подешавања, не могу да отворим „%s“: %s"
 
-#: vncviewer/parameters.cxx:578 vncviewer/parameters.cxx:583
-#: vncviewer/parameters.cxx:608 vncviewer/parameters.cxx:621
-#: vncviewer/parameters.cxx:637
+#: vncviewer/parameters.cxx:585 vncviewer/parameters.cxx:590
+#: vncviewer/parameters.cxx:615 vncviewer/parameters.cxx:628
+#: vncviewer/parameters.cxx:644
 #, c-format
 msgid "Failed to read line %d in file %s: %s"
 msgstr "Нисам успео да прочитам %d. ред у датотеци „%s“: %s"
 
-#: vncviewer/parameters.cxx:584
+#: vncviewer/parameters.cxx:591
 msgid "Line too long"
 msgstr "Ред је предуг"
 
-#: vncviewer/parameters.cxx:591
+#: vncviewer/parameters.cxx:598
 #, c-format
 msgid "Configuration file %s is in an invalid format"
 msgstr "Датотека подешавања „%s“ је у неисправном запису"
 
-#: vncviewer/parameters.cxx:609
+#: vncviewer/parameters.cxx:616
 msgid "Invalid format"
 msgstr "Неисправан запис"
 
-#: vncviewer/parameters.cxx:622 vncviewer/parameters.cxx:638
+#: vncviewer/parameters.cxx:629 vncviewer/parameters.cxx:645
 msgid "Invalid format or too large value"
 msgstr "Неисправан запис или предуга вредност"
 
-#: vncviewer/parameters.cxx:665
+#: vncviewer/parameters.cxx:672
 #, c-format
 msgid "Unknown parameter %s on line %d in file %s"
 msgstr "Непознат параметар „%s“ у %d. реду у датотеци „%s“"
@@ -631,86 +625,92 @@
 msgid "About TigerVNC Viewer"
 msgstr "О програму"
 
-#: vncviewer/vncviewer.cxx:144 vncviewer/vncviewer.cxx:156
+#: vncviewer/vncviewer.cxx:140
+msgid "Internal FLTK error. Exiting."
+msgstr "Унутрашња ФЛТК грешка. Излазим."
+
+#: vncviewer/vncviewer.cxx:158 vncviewer/vncviewer.cxx:170
 #, c-format
 msgid "Error starting new TigerVNC Viewer: %s"
 msgstr "Грешка покретања новог примерка програма: %s"
 
-#: vncviewer/vncviewer.cxx:165
+#: vncviewer/vncviewer.cxx:179
 #, c-format
 msgid "Termination signal %d has been received. TigerVNC Viewer will now exit."
 msgstr "Примљен је сигнал за окончавање %d. Програм ће сада изаћи."
 
-#: vncviewer/vncviewer.cxx:257
+#: vncviewer/vncviewer.cxx:271
 msgid "TigerVNC Viewer"
 msgstr "Прегледач ТигарВНЦ"
 
-#: vncviewer/vncviewer.cxx:265
+#: vncviewer/vncviewer.cxx:279
 msgid "No"
 msgstr "Не"
 
-#: vncviewer/vncviewer.cxx:266
+#: vncviewer/vncviewer.cxx:280
 msgid "Yes"
 msgstr "Да"
 
-#: vncviewer/vncviewer.cxx:269
+#: vncviewer/vncviewer.cxx:283
 msgid "Close"
 msgstr "Затвори"
 
-#: vncviewer/vncviewer.cxx:274
+#: vncviewer/vncviewer.cxx:288
 msgid "About"
 msgstr "О програму"
 
-#: vncviewer/vncviewer.cxx:277
+#: vncviewer/vncviewer.cxx:291
 msgid "Hide"
 msgstr "Сакриј"
 
-#: vncviewer/vncviewer.cxx:280
+#: vncviewer/vncviewer.cxx:294
 msgid "Quit"
 msgstr "Изађи"
 
-#: vncviewer/vncviewer.cxx:284
+#: vncviewer/vncviewer.cxx:298
 msgid "Services"
 msgstr "Услуге"
 
-#: vncviewer/vncviewer.cxx:285
+#: vncviewer/vncviewer.cxx:299
 msgid "Hide Others"
 msgstr "Сакриј остале"
 
-#: vncviewer/vncviewer.cxx:286
+#: vncviewer/vncviewer.cxx:300
 msgid "Show All"
 msgstr "Прикажи све"
 
-#: vncviewer/vncviewer.cxx:295
+#: vncviewer/vncviewer.cxx:309
 msgctxt "SysMenu|"
 msgid "&File"
 msgstr "&Датотека"
 
-#: vncviewer/vncviewer.cxx:298
+#: vncviewer/vncviewer.cxx:312
 msgctxt "SysMenu|File|"
 msgid "&New Connection"
 msgstr "&Нова веза"
 
-#: vncviewer/vncviewer.cxx:310
+#: vncviewer/vncviewer.cxx:324
 msgid "Could not create VNC home directory: can't obtain home directory path."
 msgstr "Не могу да направим личну фасциклу ВНЦ-а: не могу да добијем путању личне фасцикле."
 
-#: vncviewer/vncviewer.cxx:315
+#: vncviewer/vncviewer.cxx:329
 #, c-format
 msgid "Could not create VNC home directory: %s."
 msgstr "Не могу да направим личну фасциклу ВНЦ-а: %s."
 
 #. TRANSLATORS: "Parameters" are command line arguments, or settings
 #. from a file or the Windows registry.
-#: vncviewer/vncviewer.cxx:520 vncviewer/vncviewer.cxx:521
+#: vncviewer/vncviewer.cxx:534 vncviewer/vncviewer.cxx:535
 msgid "Parameters -listen and -via are incompatible"
 msgstr "Параметри „-listen“ и „-via“ нису сагласни"
 
-#: vncviewer/vncviewer.cxx:536
+#: vncviewer/vncviewer.cxx:550
 #, c-format
 msgid "Listening on port %d"
 msgstr "Ослушкујем на прикључнику %d"
 
-#: vncviewer/vncviewer.cxx:601
-msgid "Internal FLTK error. Exiting."
-msgstr "Унутрашња ФЛТК грешка. Излазим."
+#~ msgid "Unknown encoding %d"
+#~ msgstr "Непознато кодирање „%d“"
+
+#~ msgid "Unknown encoding"
+#~ msgstr "Непознато кодирање"
diff --git a/unix/vncserver b/unix/vncserver
index 674eada..6c29a75 100755
--- a/unix/vncserver
+++ b/unix/vncserver
@@ -26,10 +26,7 @@
 # vncserver - wrapper script to start an X VNC server.
 #
 
-#
 # First make sure we're operating in a sane environment.
-#
-
 $exedir = "";
 $slashndx = rindex($0, "/");
 if($slashndx>=0) {
@@ -41,7 +38,8 @@
 &SanityCheck();
 
 #
-# Global variables.  You may want to configure some of these for your site.
+# Global variables.  You may want to configure some of these for
+# your site
 #
 
 $geometry = "1024x768";
@@ -51,10 +49,16 @@
                  ((-d "/usr/local/vnc/classes") && "/usr/local/vnc/classes"));
                  
 $vncUserDir = "$ENV{HOME}/.vnc";
+$vncUserConfig = "$vncUserDir/config";
+
+$vncSystemConfigDir = "/etc/tigervnc";
+$vncSystemConfigDefaultsFile = "$vncSystemConfigDir/vncserver-config-defaults";
+$vncSystemConfigMandatoryFile = "$vncSystemConfigDir/vncserver-config-mandatory";
+
 $skipxstartup = 0;
 $xauthorityFile = "$ENV{XAUTHORITY}" || "$ENV{HOME}/.Xauthority";
 
-$xstartup = $vncUserDir . "/xstartup";
+$xstartupFile = $vncUserDir . "/xstartup";
 $defaultXStartup
     = ("#!/bin/sh\n\n".
        "unset SESSION_MANAGER\n".
@@ -159,7 +163,7 @@
     $skipxstartup = 1;
 }
 if ($opt{'-xstartup'}) {
-    $xstartup = $opt{'-xstartup'};
+    $xstartupFile = $opt{'-xstartup'};
 }
 if ($opt{'-fp'}) {
     $fontPath = $opt{'-fp'};
@@ -168,22 +172,89 @@
 
 &CheckGeometryAndDepth();
 
-
 # Create the user's vnc directory if necessary.
-
 if (!(-e $vncUserDir)) {
     if (!mkdir($vncUserDir,0755)) {
 	die "$prog: Could not create $vncUserDir.\n";
     }
 }
     
+# Find display number.
+if ((@ARGV > 0) && ($ARGV[0] =~ /^:(\d+)$/)) {
+    $displayNumber = $1;
+    shift(@ARGV);
+    if (!&CheckDisplayNumber($displayNumber)) {
+	die "A VNC server is already running as :$displayNumber\n";
+    }
+} elsif ((@ARGV > 0) && ($ARGV[0] !~ /^-/) && ($ARGV[0] !~ /^\+/)) {
+    &Usage();
+} else {
+    $displayNumber = &GetDisplayNumber();
+}
+
+$vncPort = 5900 + $displayNumber;
+
+if ($opt{'-name'}) {
+    $desktopName = $opt{'-name'};
+} else {
+    $desktopName = "$host:$displayNumber ($ENV{USER})";
+}
+
+my %default_opts;
+my %config;
+
+# We set some reasonable defaults. Config file settings
+# override these where present.
+$default_opts{desktop} = &quotedString($desktopName);
+$default_opts{httpd} = $vncJavaFiles if ($vncJavaFiles);
+$default_opts{auth} = $xauthorityFile;
+$default_opts{geometry} = $geometry if ($geometry);
+$default_opts{depth} = $depth if ($depth);
+$default_opts{pixelformat} = $pixelformat if ($pixelformat);
+$default_opts{rfbwait} = 30000;
+$default_opts{rfbauth} = "$vncUserDir/passwd";
+$default_opts{rfbport} = $vncPort;
+$default_opts{fp} = $fontPath if ($fontPath);
+$default_opts{pn} = "";
+
+# Load user-overrideable system defaults
+LoadConfig($vncSystemConfigDefaultsFile);
+
+# Then the user's settings
+LoadConfig($vncUserConfig);
+
+# And then override anything set above if mandatory settings exist.
+# WARNING: "Mandatory" is used loosely here! As the man page says,
+# there is nothing stopping someone from EASILY subverting the
+# settings in $vncSystemConfigMandatoryFile by simply passing
+# CLI args to vncserver, which trump config files! To properly
+# hard force policy in a non-subvertible way would require major
+# development work that touches Xvnc itself.
+LoadConfig($vncSystemConfigMandatoryFile, 1);
+
+#
 # Check whether VNC authentication is enabled, and if so, prompt the user to
 # create a VNC password if they don't already have one.
+#
 
 $securityTypeArgSpecified = 0;
 $vncAuthEnabled = 0;
 $passwordArgSpecified = 0;
+@vncAuthStrings = ("vncauth", "tlsvnc", "x509vnc");
 
+# ...first we check our configuration files' settings
+if ($config{'securitytypes'}) {
+  $securityTypeArgSpecified = 1;
+  foreach $arg2 (split(',', $config{'securitytypes'})) {
+    if (grep {$_ eq lc($arg2)} @vncAuthStrings) {
+      $vncAuthEnabled = 1;
+    }
+  }
+}
+
+# ...and finally we check CLI args, which in the case of the topic at
+# hand (VNC auth or not), override anything found in configuration files
+# (even so-called "mandatory" settings).
 for ($i = 0; $i < @ARGV; ++$i) {
     # -SecurityTypes can be followed by a space or "="
     my @splitargs = split('=', $ARGV[$i]);
@@ -195,8 +266,7 @@
             $securityTypeArgSpecified = 1;
         }
         foreach $arg2 (split(',', @splitargs[1])) {
-            if (lc($arg2) eq "vncauth" || lc($arg2) eq "tlsvnc"
-             || lc($arg2) eq "x509vnc") {
+            if (grep {$_ eq lc($arg2)} @vncAuthStrings) {
                 $vncAuthEnabled = 1;
             }
         }
@@ -218,22 +288,6 @@
         }
     }
 }
- 
-# Find display number.
-
-if ((@ARGV > 0) && ($ARGV[0] =~ /^:(\d+)$/)) {
-    $displayNumber = $1;
-    shift(@ARGV);
-    if (!&CheckDisplayNumber($displayNumber)) {
-	die "A VNC server is already running as :$displayNumber\n";
-    }
-} elsif ((@ARGV > 0) && ($ARGV[0] !~ /^-/) && ($ARGV[0] !~ /^\+/)) {
-    &Usage();
-} else {
-    $displayNumber = &GetDisplayNumber();
-}
-
-$vncPort = 5900 + $displayNumber;
 
 $desktopLog = "$vncUserDir/$host:$displayNumber.log";
 unlink($desktopLog);
@@ -247,52 +301,14 @@
 print XAUTH "add $host/unix:$displayNumber . $cookie\n";
 close(XAUTH);
 
-if ($opt{'-name'}) {
-    $desktopName = $opt{'-name'};
-} else {
-    $desktopName = "$host:$displayNumber ($ENV{USER})";
-}
-
 # Now start the X VNC Server
 
+# We build up our Xvnc command with options
 $cmd = $exedir."Xvnc :$displayNumber";
 
-my %default_opts;
-my %config;
-
-$default_opts{desktop} = &quotedString($desktopName);
-$default_opts{httpd} = $vncJavaFiles if ($vncJavaFiles);
-$default_opts{auth} = $xauthorityFile;
-$default_opts{geometry} = $geometry if ($geometry);
-$default_opts{depth} = $depth if ($depth);
-$default_opts{pixelformat} = $pixelformat if ($pixelformat);
-$default_opts{rfbwait} = 30000;
-$default_opts{rfbauth} = "$vncUserDir/passwd";
-$default_opts{rfbport} = $vncPort;
-$default_opts{fp} = $fontPath if ($fontPath);
-$default_opts{pn} = "";
-
-# if a user configuration file already exists
-if(stat("$vncUserDir/config")) {
-
-  # loads and parses configuration file
-  if(open(IN, "$vncUserDir/config")) {
-    while(<IN>) {
-      next if /^#/;
-      if(my ($k, $v) = /^\s*(\w+)\s*=\s*(.+)$/) {
-        $config{$k} = $v;
-      } elsif ($_ =~ m/^\s*(\S+)/) {
-        $config{$1} = $k;
-      }
-    }
-    close(IN);
-  }
-}
-
 foreach my $k (sort keys %config) {
   $cmd .= " -$k $config{$k}";
-  # user's option takes precedence
-  delete $default_opts{$k};
+  delete $default_opts{$k}; # file options take precedence
 }
 
 foreach my $k (sort keys %default_opts) {
@@ -300,17 +316,14 @@
 }
 
 # Add color database stuff here, e.g.:
-#
 # $cmd .= " -co /usr/lib/X11/rgb";
-#
 
 foreach $arg (@ARGV) {
-    $cmd .= " " . &quotedString($arg);
+  $cmd .= " " . &quotedString($arg);
 }
 $cmd .= " >> " . &quotedString($desktopLog) . " 2>&1";
 
 # Run $cmd and record the process ID.
-
 $pidFile = "$vncUserDir/$host:$displayNumber.pid";
 system("$cmd & echo \$! >$pidFile");
 
@@ -347,19 +360,17 @@
 warn "\nNew '$desktopName' desktop is $host:$displayNumber\n\n";
 
 # Create the user's xstartup script if necessary.
-
 if (! $skipxstartup) {
-    if (!(-e "$xstartup")) {
-	warn "Creating default startup script $xstartup\n";
-	open(XSTARTUP, ">$xstartup");
+    if (!(-e "$xstartupFile")) {
+	warn "Creating default startup script $xstartupFile\n";
+	open(XSTARTUP, ">$xstartupFile");
         print XSTARTUP $defaultXStartup;
         close(XSTARTUP);
-        chmod 0755, "$xstartup";
+        chmod 0755, "$xstartupFile";
     }
 }
 
 # Create the user's config file if necessary.
-
 if (!(-e "$vncUserDir/config")) {
     warn "Creating default config $vncUserDir/config\n";
     open(VNCUSERCONFIG, ">$vncUserDir/config");
@@ -369,9 +380,8 @@
 }
 
 # Run the X startup script.
-
 if (! $skipxstartup) {
-    warn "Starting applications specified in $xstartup\n";
+    warn "Starting applications specified in $xstartupFile\n";
 }
 warn "Log file is $desktopLog\n\n";
 
@@ -389,7 +399,7 @@
 
 if ($opt{'-fg'}) {
     if (! $skipxstartup) {
-        system("$xstartup >> " . &quotedString($desktopLog) . " 2>&1");
+        system("$xstartupFile >> " . &quotedString($desktopLog) . " 2>&1");
     }
     if (kill 0, `cat $pidFile`) {
         $opt{'-kill'} = ':'.$displayNumber;
@@ -398,12 +408,12 @@
 } else {
     if ($opt{'-autokill'}) {
     	if (! $skipxstartup) {
-            system("($xstartup; $0 -kill :$displayNumber) >> "
+            system("($xstartupFile; $0 -kill :$displayNumber) >> "
 	     . &quotedString($desktopLog) . " 2>&1 &");
     	}
     } else {
     	if (! $skipxstartup) {
-            system("$xstartup >> " . &quotedString($desktopLog)
+            system("$xstartupFile >> " . &quotedString($desktopLog)
 	     . " 2>&1 &");
     	}
     }
@@ -411,8 +421,46 @@
 
 exit;
 
-
 ###############################################################################
+# Functions
+###############################################################################
+
+#
+# Populate the global %config hash with settings from a specified
+# vncserver configuration file if it exists
+#
+# Args: 1. file path
+#       2. optional boolean flag to enable warning when a previously
+#          set configuration setting is being overridden
+#
+sub LoadConfig {
+  local ($configFile, $warnoverride) = @_;
+  local ($toggle) = undef;
+
+  if (stat($configFile)) {
+    if (open(IN, $configFile)) {
+      while (<IN>) {
+        next if /^#/;
+        if (my ($k, $v) = /^\s*(\w+)\s*=\s*(.+)$/) {
+          $k = lc($k); # must normalize key case
+          if ($warnoverride && $config{$k}) {
+            print("Warning: $configFile is overriding previously defined '$k' to be '$v'\n");
+          }
+          $config{$k} = $v;
+        } elsif ($_ =~ m/^\s*(\S+)/) {
+          # We can't reasonably warn on override of toggles (e.g. AlwaysShared)
+          # because it would get crazy to do so. We'd have to check if the
+          # current config file being loaded defined the logical opposite setting
+          # (NeverShared vs. AlwaysShared, etc etc).
+          $toggle = lc($1); # must normalize key case
+          $config{$toggle} = $k;
+        }
+      }
+      close(IN);
+    }
+  }
+}
+
 #
 # CheckGeometryAndDepth simply makes sure that the geometry and depth values
 # are sensible.
@@ -757,18 +805,12 @@
 }
 
 
-#
 # Routine to make sure we're operating in a sane environment.
-#
-
 sub SanityCheck
 {
     local ($cmd);
 
-    #
     # Get the program name
-    #
-
     ($prog) = ($0 =~ m|([^/]+)$|);
 
     #
@@ -810,14 +852,9 @@
 	}
     }
 
-    #
-    # Check the HOME environment variable is set
-    #
-
     if (!defined($ENV{HOME})) {
 	die "$prog: The HOME environment variable is not set.\n";
     }
-#    chdir($ENV{HOME});
 
     #
     # Find socket constants. 'use Socket' is a perl5-ism, so we wrap it in an
diff --git a/unix/vncserver.man b/unix/vncserver.man
index fd7e93a..9108683 100644
--- a/unix/vncserver.man
+++ b/unix/vncserver.man
@@ -147,6 +147,26 @@
 started.  If this file does not exist, then vncserver will create a default
 xstartup script which attempts to launch your chosen window manager.
 .TP
+/etc/tigervnc/vncserver-config-defaults
+The optional system-wide equivalent of $HOME/.vnc/config. If this file exists
+and defines options to be passed to Xvnc, they will be used as defaults for
+users. The user's $HOME/.vnc/config overrides settings configured in this file.
+The overall configuration file load order is: this file, $HOME/.vnc/config,
+and then /etc/tigervnc/vncserver-config-mandatory. None are required to exist.
+.TP
+/etc/tigervnc/vncserver-config-mandatory
+The optional system-wide equivalent of $HOME/.vnc/config. If this file exists
+and defines options to be passed to Xvnc, they will override any of the same
+options defined in a user's $HOME/.vnc/config. This file offers a mechanism
+to establish some basic form of system-wide policy. WARNING! There is
+nothing stopping users from constructing their own vncserver-like script
+that calls Xvnc directly to bypass any options defined in
+/etc/tigervnc/vncserver-config-mandatory.  Likewise, any CLI arguments passed
+to vncserver will override ANY config file setting of the same name. The
+overall configuration file load order is:
+/etc/tigervnc/vncserver-config-defaults, $HOME/.vnc/config, and then this file.
+None are required to exist.
+.TP
 $HOME/.vnc/config
 An optional server config file wherein options to be passed to Xvnc are listed
 to avoid hard-coding them to the physical invocation. List options in this file
diff --git a/unix/xserver/hw/vnc/Input.c b/unix/xserver/hw/vnc/Input.c
index 55befa7..64305cb 100644
--- a/unix/xserver/hw/vnc/Input.c
+++ b/unix/xserver/hw/vnc/Input.c
@@ -33,7 +33,9 @@
 #include "inpututils.h"
 #endif
 #include "mi.h"
+#include "mipointer.h"
 #include "exevents.h"
+#include "scrnintstr.h"
 #include "xkbsrv.h"
 #include "xkbstr.h"
 #include "xserver-properties.h"
@@ -186,8 +188,16 @@
 
 void vncGetPointerPos(int *x, int *y)
 {
-	if (vncPointerDev != NULL)
-		GetSpritePosition(vncPointerDev, &cursorPosX, &cursorPosY);
+	if (vncPointerDev != NULL) {
+		ScreenPtr ptrScreen;
+
+		miPointerGetPosition(vncPointerDev, &cursorPosX, &cursorPosY);
+
+		/* Pointer coordinates are screen relative */
+		ptrScreen = miPointerGetScreen(vncPointerDev);
+		cursorPosX += ptrScreen->x;
+		cursorPosY += ptrScreen->y;
+	}
 
 	*x = cursorPosX;
 	*y = cursorPosY;
diff --git a/unix/xserver/hw/vnc/XorgGlue.c b/unix/xserver/hw/vnc/XorgGlue.c
index d7892b1..712ed6a 100644
--- a/unix/xserver/hw/vnc/XorgGlue.c
+++ b/unix/xserver/hw/vnc/XorgGlue.c
@@ -92,6 +92,16 @@
   *blueMask = vis->blueMask;
 }
 
+int vncGetScreenX(int scrIdx)
+{
+  return screenInfo.screens[scrIdx]->x;
+}
+
+int vncGetScreenY(int scrIdx)
+{
+  return screenInfo.screens[scrIdx]->y;
+}
+
 int vncGetScreenWidth(int scrIdx)
 {
   return screenInfo.screens[scrIdx]->width;
diff --git a/unix/xserver/hw/vnc/XorgGlue.h b/unix/xserver/hw/vnc/XorgGlue.h
index 92b0d18..5cae860 100644
--- a/unix/xserver/hw/vnc/XorgGlue.h
+++ b/unix/xserver/hw/vnc/XorgGlue.h
@@ -33,6 +33,8 @@
                         int *trueColour, int *bigEndian,
                         int *redMask, int *greenMask, int *blueMask);
 
+int vncGetScreenX(int scrIdx);
+int vncGetScreenY(int scrIdx);
 int vncGetScreenWidth(int scrIdx);
 int vncGetScreenHeight(int scrIdx);
 
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc
index 4eaa41f..4f82a54 100644
--- a/unix/xserver/hw/vnc/XserverDesktop.cc
+++ b/unix/xserver/hw/vnc/XserverDesktop.cc
@@ -514,6 +514,8 @@
       // We are responsible for propagating mouse movement between clients
       int cursorX, cursorY;
       vncGetPointerPos(&cursorX, &cursorY);
+      cursorX -= vncGetScreenX(screenIndex);
+      cursorY -= vncGetScreenY(screenIndex);
       if (oldCursorPos.x != cursorX || oldCursorPos.y != cursorY) {
         oldCursorPos.x = cursorX;
         oldCursorPos.y = cursorY;
@@ -648,7 +650,8 @@
 
 void XserverDesktop::pointerEvent(const Point& pos, int buttonMask)
 {
-  vncPointerMove(pos.x, pos.y);
+  vncPointerMove(pos.x + vncGetScreenX(screenIndex),
+                 pos.y + vncGetScreenY(screenIndex));
   vncPointerButtonAction(buttonMask);
 }
 
diff --git a/unix/xserver/hw/vnc/vncExtInit.cc b/unix/xserver/hw/vnc/vncExtInit.cc
index 36d3742..dea3cb8 100644
--- a/unix/xserver/hw/vnc/vncExtInit.cc
+++ b/unix/xserver/hw/vnc/vncExtInit.cc
@@ -394,10 +394,14 @@
   desktop[scrIdx]->add_copied(reg, rfb::Point(dx, dy));
 }
 
-void vncSetCursor(int scrIdx, int width, int height, int hotX, int hotY,
+void vncSetCursor(int width, int height, int hotX, int hotY,
                   const unsigned char *rgbaData)
 {
-  desktop[scrIdx]->setCursor(width, height, hotX, hotY, rgbaData);
+  for (int scr = 0; scr < vncGetScreenCount(); scr++) {
+    if (desktop[scr] == NULL)
+      continue;
+    desktop[scr]->setCursor(width, height, hotX, hotY, rgbaData);
+  }
 }
 
 void vncPreScreenResize(int scrIdx)
diff --git a/unix/xserver/hw/vnc/vncExtInit.h b/unix/xserver/hw/vnc/vncExtInit.h
index a0914ad..9785d11 100644
--- a/unix/xserver/hw/vnc/vncExtInit.h
+++ b/unix/xserver/hw/vnc/vncExtInit.h
@@ -84,7 +84,7 @@
                   int nRects, const struct UpdateRect *rects,
                   int dx, int dy);
 
-void vncSetCursor(int scrIdx, int width, int height, int hotX, int hotY,
+void vncSetCursor(int width, int height, int hotX, int hotY,
                   const unsigned char *rgbaData);
 
 void vncPreScreenResize(int scrIdx);
diff --git a/unix/xserver/hw/vnc/vncHooks.c b/unix/xserver/hw/vnc/vncHooks.c
index b21f4c6..22ea9ea 100644
--- a/unix/xserver/hw/vnc/vncHooks.c
+++ b/unix/xserver/hw/vnc/vncHooks.c
@@ -699,7 +699,7 @@
     }
 #endif
 
-    vncSetCursor(pScreen->myNum, width, height, hotX, hotY, rgbaData);
+    vncSetCursor(width, height, hotX, hotY, rgbaData);
 
     free(rgbaData);
   }
diff --git a/unix/xserver/hw/vnc/xvnc.c b/unix/xserver/hw/vnc/xvnc.c
index 80148ca..c5b684d 100644
--- a/unix/xserver/hw/vnc/xvnc.c
+++ b/unix/xserver/hw/vnc/xvnc.c
@@ -854,6 +854,40 @@
 static Bool
 vfbCursorOffScreen (ScreenPtr *ppScreen, int *x, int *y)
 {
+    int absX, absY;
+    int i;
+
+    if (screenInfo.numScreens == 1)
+        return FALSE;
+
+    if ((*x >= 0) && (*x < (*ppScreen)->width) &&
+        (*y >= 0) && (*y < (*ppScreen)->height))
+        return FALSE;
+
+    absX = *x + (*ppScreen)->x;
+    absY = *y + (*ppScreen)->y;
+
+    for (i = 0;i < screenInfo.numScreens;i++) {
+        ScreenPtr newScreen;
+
+        newScreen = screenInfo.screens[i];
+
+        if (absX < newScreen->x)
+            continue;
+        if (absY < newScreen->y)
+            continue;
+        if (absX >= (newScreen->x + newScreen->width))
+            continue;
+        if (absY >= (newScreen->y + newScreen->height))
+            continue;
+
+        *ppScreen = newScreen;
+        *x = absX - newScreen->x;
+        *y = absY - newScreen->y;
+
+        return TRUE;
+    }
+
     return FALSE;
 }
 
@@ -1456,11 +1490,10 @@
 vfbScreenInit(ScreenPtr pScreen, int argc, char **argv)
 #endif
 {
-#if XORG < 113
-    vfbScreenInfoPtr pvfb = &vfbScreens[index];
-#else
-    vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
+#if XORG >= 113
+    int index = pScreen->myNum;
 #endif
+    vfbScreenInfoPtr pvfb = &vfbScreens[index];
     int dpi;
     int ret;
     void *pbits;
@@ -1481,13 +1514,8 @@
 
     pbits = vfbAllocateFramebufferMemory(&pvfb->fb);
     if (!pbits) return FALSE;
-#if XORG < 113
     vncFbptr[index] = pbits;
     vncFbstride[index] = pvfb->fb.paddedWidth;
-#else
-    vncFbptr[pScreen->myNum] = pbits;
-    vncFbstride[pScreen->myNum] = pvfb->fb.paddedWidth;
-#endif
 
     miSetPixmapDepths();
 
@@ -1524,6 +1552,12 @@
 	return FALSE;
     }
 
+    if (index > 0) {
+        ScreenPtr prevScreen = screenInfo.screens[index-1];
+        pScreen->x = prevScreen->x + prevScreen->width;
+        pScreen->y = 0;
+    }
+
     ret = fbScreenInit(pScreen, pbits, pvfb->fb.width, pvfb->fb.height,
 		       dpi, dpi, pvfb->fb.paddedWidth, pvfb->fb.bitsPerPixel);
   
diff --git a/win/winvnc/winvnc.cxx b/win/winvnc/winvnc.cxx
index 57f9f3d..aa41bcb 100644
--- a/win/winvnc/winvnc.cxx
+++ b/win/winvnc/winvnc.cxx
@@ -170,8 +170,16 @@
         i = argc;
 
         // Try to clean up earlier services we've had
-        rfb::win32::unregisterService("WinVNC4");
-        rfb::win32::unregisterService("TigerVNC Server");
+        try {
+          rfb::win32::unregisterService("WinVNC4");
+        } catch (rdr::SystemException) {
+          // Do nothing as we might fail simply because there was no
+          // service to remove
+        }
+        try {
+          rfb::win32::unregisterService("TigerVNC Server");
+        } catch (rdr::SystemException) {
+        }
 
         if (rfb::win32::registerService(VNCServerService::Name,
                                         _T("TigerVNC Server"),