]> source.dussan.org Git - tigervnc.git/commitdiff
Make sure to prefix even new desktop names with "VNC:".
authorPeter Åstrand <astrand@cendio.se>
Thu, 15 Jan 2009 13:36:03 +0000 (13:36 +0000)
committerPeter Åstrand <astrand@cendio.se>
Thu, 15 Jan 2009 13:36:03 +0000 (13:36 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3552 3789f03b-4d11-0410-bbf8-ca57d06f2519

unix/vncviewer/CConn.cxx

index cab776a9acb5406acbf2336afe3329e5ca011de2..7308eb18bc6065895fcb170e52eb2ccac5a2fb0b 100644 (file)
@@ -275,8 +275,15 @@ void CConn::setDesktopSize(int w, int h) {
 // setName() is called when the desktop name changes
 void CConn::setName(const char* name) {
   CConnection::setName(name);
+
+  CharArray windowNameStr(windowName.getData());
+  if (!windowNameStr.buf[0]) {
+    windowNameStr.replaceBuf(new char[256]);
+    snprintf(windowNameStr.buf, 256, _("VNC: %.240s"), cp.name());
+  }
+
   if (viewport) {
-    viewport->setName(name);
+    viewport->setName(windowNameStr.buf);
   }
 }