From: george82 Date: Mon, 11 Sep 2006 15:56:10 +0000 (+0000) Subject: Now the vncviewer window title display the remote desktop X-Git-Tag: v0.0.90~384^2~219 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e0569e43b29eec58926aaac23360354c738fc893;p=tigervnc.git Now the vncviewer window title display the remote desktop name and the scale value. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@664 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/win/vncviewer/DesktopWindow.cxx b/win/vncviewer/DesktopWindow.cxx index 197449d2..0feb24ee 100644 --- a/win/vncviewer/DesktopWindow.cxx +++ b/win/vncviewer/DesktopWindow.cxx @@ -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)); } diff --git a/win/vncviewer/DesktopWindow.h b/win/vncviewer/DesktopWindow.h index 9c2f1f3e..f8d3ac32 100644 --- a/win/vncviewer/DesktopWindow.h +++ b/win/vncviewer/DesktopWindow.h @@ -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;