From e0569e43b29eec58926aaac23360354c738fc893 Mon Sep 17 00:00:00 2001 From: george82 Date: Mon, 11 Sep 2006 15:56:10 +0000 Subject: [PATCH] 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 --- win/vncviewer/DesktopWindow.cxx | 7 ++++++- win/vncviewer/DesktopWindow.h | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) 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; -- 2.39.5