From 18ec722cf2de4a650d4056012c1458cc2c142721 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sun, 5 Nov 2006 15:34:18 +0000 Subject: [PATCH] Bug Fix: Window title was not updated in new window. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15750 a592a061-630c-0410-9148-cb99ea01b6c8 --- Status.15x | 15 ++++++++++----- src/frontends/LyXView.C | 6 +----- src/frontends/qt4/GuiView.C | 12 ++++++++++-- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/Status.15x b/Status.15x index 895b073702..a2e2586a86 100644 --- a/Status.15x +++ b/Status.15x @@ -96,9 +96,6 @@ MULTIPLE WINDOWS / DOCUMENTS 2) the easy way: disable the cursor on focus out event and re-enable it at focus in event and jump the saved position (at focus out). -* The title bar does not contain the document name when a new window is opened - (Joost 4/11/06). - * There should be a close button on the tabs (Joost 3/11/06). @@ -240,12 +237,12 @@ CREDITS: * Performance on Windows is bad. On my system, scrolling the User Guide takes 10 seconds with LyX 1.4 and more than 30 seconds with LyX 1.5. - FIXED (Abdel 04/10/06): This was due to spurious message in QLPainter.C, + FIXED (Abdel 04/11/06): This was due to spurious message in QLPainter.C, * When I have the same document in two windows, only the last selected paragraph in one of the windows gets updated. - FIXED (Abdel 04/10/06): This was due my singlePar optimization. With my last + FIXED (Abdel 04/11/06): This was due my singlePar optimization. With my last commit, the optimization is enabled only if the WorkArea has the focus. * No icon for "note-next" in the "review" toolbar. @@ -255,3 +252,11 @@ CREDITS: * Branches gui broken (buttons do nothing). FIXED (JSpitzm 2006-11-04). + +* The title bar does not contain the document name when a new window is opened + (Joost 4/11/06). + + FIXED (Abdel 05/11/06): This was due to "last_title" being a static variable + in LyXView::updateWindowTitle() and also due to a potential bug in Qt: + an update command to the window title seems to be ignored up until the window + is shown. diff --git a/src/frontends/LyXView.C b/src/frontends/LyXView.C index b5ad753103..fa6da758ad 100644 --- a/src/frontends/LyXView.C +++ b/src/frontends/LyXView.C @@ -375,7 +375,6 @@ void LyXView::updateLayoutChoice() void LyXView::updateWindowTitle() { - static docstring last_title = lyx::from_ascii("LyX"); docstring maximize_title = lyx::from_ascii("LyX"); docstring minimize_title = lyx::from_ascii("LyX"); @@ -393,10 +392,7 @@ void LyXView::updateWindowTitle() } } - if (maximize_title != last_title) { - setWindowTitle(maximize_title, minimize_title); - last_title = maximize_title; - } + setWindowTitle(maximize_title, minimize_title); } diff --git a/src/frontends/qt4/GuiView.C b/src/frontends/qt4/GuiView.C index a74dc452ba..6696e69f84 100644 --- a/src/frontends/qt4/GuiView.C +++ b/src/frontends/qt4/GuiView.C @@ -220,6 +220,10 @@ void GuiView::setGeometry(unsigned int width, } show(); + + // For an unknown reason, the Window title update is not effective for + // the second windows up until it is shown on screen (Qt bug?). + updateWindowTitle(); } @@ -231,8 +235,12 @@ void GuiView::updateMenu(QAction * /*action*/) void GuiView::setWindowTitle(docstring const & t, docstring const & it) { - QMainWindow::setWindowTitle(toqstr(t)); - QMainWindow::setWindowIconText(toqstr(it)); + QString title = windowTitle(); + QString new_title = toqstr(t); + if (title != new_title) { + QMainWindow::setWindowTitle(new_title); + QMainWindow::setWindowIconText(toqstr(it)); + } } -- 2.39.2