diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 23135e964..e54ce45ed 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -1131,17 +1131,26 @@ void MainWindow::on_actionStatistics_triggered() void MainWindow::showEvent(QShowEvent *e) { qDebug("** Show Event **"); + e->accept(); - if (currentTabWidget() == m_transferListWidget) - m_propertiesWidget->loadDynamicData(); + if (isVisible()) + { + // preparations before showing the window - e->accept(); + if (currentTabWidget() == m_transferListWidget) + m_propertiesWidget->loadDynamicData(); - // Make sure the window is initially centered - if (!m_posInitialized) + // Make sure the window is initially centered + if (!m_posInitialized) + { + move(Utils::Gui::screenCenter(this)); + m_posInitialized = true; + } + } + else { - move(Utils::Gui::screenCenter(this)); - m_posInitialized = true; + // to avoid blank screen when restoring from tray icon + show(); } }