# HG changeset patch # User John W. Eaton # Date 1623244483 14400 # Node ID 710c2cb73c2d381f0e56ff7877f07eb106078056 # Parent c9eaf405f691ee7b2e63b1926e98b98dc2eecc37 allow WM to give title bar to release notes and news windows (bug #60752) * main-window.cc (main_window::~main_window): Explicitly delete m_release_notes_window and m_community_news_window. (main_window::display_release_notes): Don't set main_window as parent of m_release_notes_window widget. (main_window::display_community_news): Don't set main_window as parent of m_community_news_window widget. diff -r c9eaf405f691 -r 710c2cb73c2d libgui/src/main-window.cc --- a/libgui/src/main-window.cc Wed Jun 09 00:34:42 2021 -0400 +++ b/libgui/src/main-window.cc Wed Jun 09 09:14:43 2021 -0400 @@ -323,6 +323,13 @@ main_window::~main_window (void) { + // These must be explicitly deleted because they are not + // intentionally not children of main_window. See the comments in + // the functions where they are constructed. + + delete m_release_notes_window; + delete m_community_news_window; + // Prevent floating dock widgets from being deleted. if (m_history_window->isFloating ()) @@ -794,7 +801,7 @@ // a title bar, so don't its parent to main_window. Do remember // to delete in the main_window destructor. - m_release_notes_window = new QWidget (this); + m_release_notes_window = new QWidget (); QTextBrowser *browser = new QTextBrowser (m_release_notes_window); browser->setText (news); @@ -869,7 +876,7 @@ // a title bar, so don't its parent to main_window. Do remember // to delete in the main_window destructor. - m_community_news_window = new QWidget (this); + m_community_news_window = new QWidget (); QTextBrowser *browser = new QTextBrowser (m_community_news_window);