]> source.dussan.org Git - tigervnc.git/commitdiff
Now the vncviewer window title display the remote desktop
authorgeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Mon, 11 Sep 2006 15:56:10 +0000 (15:56 +0000)
committergeorge82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Mon, 11 Sep 2006 15:56:10 +0000 (15:56 +0000)
name and the scale value.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@664 3789f03b-4d11-0410-bbf8-ca57d06f2519

win/vncviewer/DesktopWindow.cxx
win/vncviewer/DesktopWindow.h

index 197449d21f8ad0f49da005729cedc460cdd77a31..0feb24ee5fbaffd584841a39038d3862b3baec61 100644 (file)
@@ -976,8 +976,12 @@ void DesktopWindow::setAutoScaling(bool as) {
 void DesktopWindow::setDesktopScaleRatio(double scale_ratio) {
   buffer->setScaleRatio(scale_ratio);
   InvalidateRect(frameHandle, 0, FALSE);
-  calculateScrollBars();
+  if (!isAutoScaling()) calculateScrollBars();
   if (isToolbarEnabled()) refreshToolbarButtons();
+  char *newTitle = new char[strlen(desktopName)+20];
+  sprintf(newTitle, "%s @ %i%%", desktopName, getDesktopScale());
+  SetWindowText(handle, TStr(newTitle));
+  delete [] newTitle;
 }
 
 void DesktopWindow::fitBufferToWindow(bool repaint) {
@@ -1129,6 +1133,7 @@ void DesktopWindow::calculateScrollBars() {
 void
 DesktopWindow::setName(const char* name) {
   SetWindowText(handle, TStr(name));
+  strCopy(desktopName, name, sizeof(desktopName));
 }
 
 
index 9c2f1f3e2310241802f30f95f3088b2bd07558af..f8d3ac320219a213cd0c99e55d43045932c9fec8 100644 (file)
@@ -240,6 +240,9 @@ namespace rfb {
       ViewerToolBar tb;
       bool showToolbar;
 
+      // Remote desktop name
+      char desktopName[255];
+
       // Local window state
       win32::ScaledDIBSectionBuffer* buffer;
       double aspect_corr;