Skip to content
Permalink
Browse files

Fix issue with tray icon double clicking.

When clicking the tray icon in rapid succession on
windows the next click on it wouldn't register.
Analysis showed the signal really didn't reach the
handler. It seems like there are some bad things
happening when calling activateWindow() in this
handler as when it is called this issue disappears.
As our setWindowState call should perform window
activation anyways we now simply rely on it and
remove the other call. Also unified both track
click handlers.

Fixes #1452
  • Loading branch information...
hacst committed Oct 30, 2014
1 parent 6f44613 commit a120c8eb28c0dfcdfdb0981c63147bb37d45df2c
Showing with 2 additions and 7 deletions.
  1. +2 −7 src/mumble/MainWindow.cpp
@@ -2682,22 +2682,17 @@ void MainWindow::trayAboutToShow() {
}

void MainWindow::on_Icon_messageClicked() {
if (isMinimized())
setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
show();
raise();
activateWindow();
}

void MainWindow::on_Icon_activated(QSystemTrayIcon::ActivationReason reason) {
switch (reason) {
case QSystemTrayIcon::Trigger:
case QSystemTrayIcon::DoubleClick:
case QSystemTrayIcon::MiddleClick:
setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
show();
raise();
activateWindow();
on_Icon_messageClicked();
default: break;
}
}

0 comments on commit a120c8e

Please sign in to comment.
You can’t perform that action at this time.