summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Åstrand <astrand@cendio.se>2009-01-27 14:36:36 +0000
committerPeter Åstrand <astrand@cendio.se>2009-01-27 14:36:36 +0000
commit7f0189df50c440f8eb8b85e8783a5eae3489fac0 (patch)
tree8c123521a4e51ec99b86cb7b36d4876c602a77c7
parent3336ac4605d9f78bfc48f37763a010530f11a6ba (diff)
downloadtigervnc-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.cxx14
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;
}