Skip to content

Commit 0b1817f

Browse files
author
ThePBone
committed
Fix 'raiseWindow()' issues (read description)
NOTE: Raising the window does not always work! KDE users can disable 'Focus Stealing Prevention' in the Window Behavior section (system settings) as a workaround.
1 parent 2fc6d33 commit 0b1817f

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

mainwindow.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -485,16 +485,17 @@ void MainWindow::CheckDBusVersion(){
485485
}
486486
//Systray
487487
void MainWindow::raiseWindow(){
488-
Qt::WindowFlags eFlags = this->windowFlags();
489-
eFlags |= Qt::WindowStaysOnTopHint;
490-
this->setWindowFlags(eFlags);
491-
this->show();
492-
eFlags &= ~Qt::WindowStaysOnTopHint;
493-
this->setWindowFlags(eFlags);
494-
this->showNormal();
495-
this->setWindowState( (windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
496-
this->raise();
497-
this->activateWindow();
488+
/*
489+
* NOTE: Raising the window does not always work!
490+
*
491+
* KDE users can disable 'Focus Stealing Prevention'
492+
* in the Window Behavior section (system settings)
493+
* as a workaround.
494+
*/
495+
show();
496+
setWindowState( (windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
497+
raise();
498+
activateWindow();
498499
}
499500
void MainWindow::setTrayVisible(bool visible){
500501
if(visible) trayIcon->show();

0 commit comments

Comments
 (0)