# HG changeset patch # User Daniel J Sebald # Date 1384752600 21600 # Node ID 73f46593a51cef6d66e6cb3721506bd252244cf1 # Parent 92b3343e28c499fd88b191605934f896079cb97b Center the Octave Community News window only when constructed (bug #40618) * main-window.cc (main_window::display_community_news): Whenever OCN is built, get desktop height and width and move OCN window to center of desktop using OCN window width() and height(). diff -r 92b3343e28c4 -r 73f46593a51c libgui/src/main-window.cc --- a/libgui/src/main-window.cc Mon Nov 18 13:06:36 2013 +0100 +++ b/libgui/src/main-window.cc Sun Nov 17 23:30:00 2013 -0600 @@ -513,6 +513,10 @@ community_news_window->setWindowTitle (tr ("Octave Community News")); community_news_window->setWindowIcon (QIcon (":/icons/logo.png")); community_news_window->resize (640, 480); + int win_x = QApplication::desktop ()->width (); + int win_y = QApplication::desktop ()->height (); + community_news_window->move ((win_x - community_news_window->width ())/2, + (win_y - community_news_window->height ())/2); } if (! community_news_window->isVisible ())