From 0592d2060e988bd2bbf8faeb917f857bded5e8c1 Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Tue, 11 Jul 2023 21:36:23 +0800 Subject: [PATCH] fix: a possible crash of restoreState() in linux with qt6.5.1 fix #952 --- src/ui/mainwindow.cc | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/ui/mainwindow.cc b/src/ui/mainwindow.cc index 9ace702e..8c693c06 100644 --- a/src/ui/mainwindow.cc +++ b/src/ui/mainwindow.cc @@ -712,24 +712,17 @@ MainWindow::MainWindow( Config::Class & cfg_ ): // Create tab list menu createTabList(); - if ( cfg.mainWindowGeometry.size() ) - restoreGeometry( cfg.mainWindowGeometry ); if ( cfg.mainWindowState.size() && !cfg.resetState ) restoreState( cfg.mainWindowState ); + if ( cfg.mainWindowGeometry.size() ) + restoreGeometry( cfg.mainWindowGeometry ); // Show the initial welcome text - - { - ArticleView * view = getCurrentArticleView(); - - history.enableAdd( false ); - - blockUpdateWindowTitle = true; - - view->showDefinition( tr( "Welcome!" ), Instances::Group::HelpGroupId ); - - history.enableAdd( cfg.preferences.storeHistory ); - } + ArticleView * view = getCurrentArticleView(); + history.enableAdd( false ); + blockUpdateWindowTitle = true; + view->showDefinition( tr( "Welcome!" ), Instances::Group::HelpGroupId ); + history.enableAdd( cfg.preferences.storeHistory ); translateLine->setFocus();