diff options
author | Peter Åstrand <astrand@cendio.se> | 2009-01-27 14:36:36 +0000 |
---|---|---|
committer | Peter Åstrand <astrand@cendio.se> | 2009-01-27 14:36:36 +0000 |
commit | 7f0189df50c440f8eb8b85e8783a5eae3489fac0 (patch) | |
tree | 8c123521a4e51ec99b86cb7b36d4876c602a77c7 | |
parent | 3336ac4605d9f78bfc48f37763a010530f11a6ba (diff) | |
download | tigervnc-7f0189df50c440f8eb8b85e8783a5eae3489fac0.tar.gz tigervnc-7f0189df50c440f8eb8b85e8783a5eae3489fac0.zip |
Make sure that the scale factor code and DesktopName support works together: Consolidated title update into DesktopWindow::setName.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3579 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | win/vncviewer/DesktopWindow.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/win/vncviewer/DesktopWindow.cxx b/win/vncviewer/DesktopWindow.cxx index 93a3ab69..2b1ca398 100644 --- a/win/vncviewer/DesktopWindow.cxx +++ b/win/vncviewer/DesktopWindow.cxx @@ -1066,10 +1066,7 @@ void DesktopWindow::fitBufferToWindow(bool repaint) { } void DesktopWindow::printScale() { - char *newTitle = new char[strlen(desktopName)+20]; - sprintf(newTitle, "%s @ %i%%", desktopName, getDesktopScale()); - SetWindowText(handle, TStr(newTitle)); - delete [] newTitle; + setName(desktopName); } void @@ -1267,8 +1264,13 @@ void DesktopWindow::resizeDesktopWindowToBuffer() { void DesktopWindow::setName(const char* name) { - SetWindowText(handle, TStr(name)); - strCopy(desktopName, name, sizeof(desktopName)); + if (name != desktopName) { + strCopy(desktopName, name, sizeof(desktopName)); + } + char *newTitle = new char[strlen(desktopName)+20]; + sprintf(newTitle, "%s @ %i%%", desktopName, getDesktopScale()); + SetWindowText(handle, TStr(newTitle)); + delete [] newTitle; } |