From: <sv...@op...> - 2024-10-21 16:57:11
|
Author: sagamusix Date: Mon Oct 21 18:57:00 2024 New Revision: 21907 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21907 Log: Merged revision(s) 21906 from trunk/OpenMPT: [Fix] Update: The tooltip informing the user about new OpenMPT updates could cause a really long hang if the previous OpenMPT session was ended in a minimized window state. As a workaround, don't show the tooltip if the window is minimized. Potentially fixes https://bugs.openmpt.org/view.php?id=1723, https://bugs.openmpt.org/view.php?id=1602, https://bugs.openmpt.org/view.php?id=1725 [Fix] Update: The update tooltip could be cut off if the first line of text was not the longest line. ........ Modified: branches/OpenMPT-1.31/ (props changed) branches/OpenMPT-1.31/mptrack/Mainbar.cpp branches/OpenMPT-1.31/mptrack/UpdateToolTip.cpp Modified: branches/OpenMPT-1.31/mptrack/Mainbar.cpp ============================================================================== --- branches/OpenMPT-1.31/mptrack/Mainbar.cpp Mon Oct 21 18:55:26 2024 (r21906) +++ branches/OpenMPT-1.31/mptrack/Mainbar.cpp Mon Oct 21 18:57:00 2024 (r21907) @@ -466,6 +466,10 @@ else SetHorizontal(); + // Trying to show the tooltip while the window is minimized hangs the application during TTM_TRACKACTIVATE. + if(!showHighLight || CMainFrame::GetMainFrame()->IsIconic()) + return true; + CRect rect; GetToolBarCtrl().GetRect(ID_UPDATE_AVAILABLE, &rect); CPoint pt = rect.CenterPoint(); @@ -473,13 +477,7 @@ CMainFrame::GetMainFrame()->GetWindowRect(rect); LimitMax(pt.x, rect.right); - if(showHighLight) - { - return m_tooltip.ShowUpdate(*this, newVersion, infoURL, rect, pt, ID_UPDATE_AVAILABLE); - } else - { - return true; - } + return m_tooltip.ShowUpdate(*this, newVersion, infoURL, rect, pt, ID_UPDATE_AVAILABLE); } Modified: branches/OpenMPT-1.31/mptrack/UpdateToolTip.cpp ============================================================================== --- branches/OpenMPT-1.31/mptrack/UpdateToolTip.cpp Mon Oct 21 18:55:26 2024 (r21906) +++ branches/OpenMPT-1.31/mptrack/UpdateToolTip.cpp Mon Oct 21 18:57:00 2024 (r21907) @@ -32,7 +32,7 @@ m_infoURL = infoURL; - CString message = MPT_CFORMAT("OpenMPT {} has been released.\nClick on this message to install the update,\nor <a>click here to see what's new.</a>")(newVersion); + CString message = MPT_CFORMAT("OpenMPT {} has been released.\nClick this message to install the update,\nor <a>click here to see what's new.</a>")(newVersion); TOOLINFO ti{}; ti.cbSize = TTTOOLINFO_V1_SIZE; ti.uFlags = TTF_TRACK | TTF_PARSELINKS; @@ -44,6 +44,7 @@ return false; SetTitle(TTI_INFO, _T("Update Available")); + SetMaxTipWidth(Util::ScalePixels(400, m_hWnd)); // When using automatic maximum width, only the first line of the text appears to be used for determining the width, causing subsequent lines to be cut off if they are longer.# SendMessage(TTM_TRACKPOSITION, 0, static_cast<LPARAM>(MAKELONG(ptScreen.x, ptScreen.y))); SendMessage(TTM_TRACKACTIVATE, TRUE, reinterpret_cast<LPARAM>(&ti)); return true; |