From eafb7dcbccd1140c685b9963aa030a45b3926a03 Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Sat, 28 Dec 2024 17:33:01 +0800 Subject: [PATCH] 1 --- src/ui/mainwindow.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ui/mainwindow.cc b/src/ui/mainwindow.cc index 425bb10a6..c568d51b5 100644 --- a/src/ui/mainwindow.cc +++ b/src/ui/mainwindow.cc @@ -2905,7 +2905,6 @@ void MainWindow::toggleMainWindow( bool ensureShow ) shown = true; } else if ( !isActiveWindow() ) { - show(); if ( cfg.preferences.raiseWindowOnSearch ) { raise(); } @@ -2913,11 +2912,11 @@ void MainWindow::toggleMainWindow( bool ensureShow ) // Rare cases, on Windows, the window can not be brought to the front. auto flags = windowFlags(); - setWindowFlags( flags | Qt::WindowStaysOnTopHint ); + setWindowFlags( flags | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint ); QTimer::singleShot( 10, this, [ this ]() { auto flags = windowFlags(); - setWindowFlags( flags & ~Qt::WindowStaysOnTopHint ); + setWindowFlags( flags ^ ( Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint ) ); } ); shown = true;