| 825 | | // Check if a message window should be made active |
| 826 | | bool activateMsgwin = Config::Chat::instance()->autoFocus(); |
| 827 | | |
| 828 | | // Don't change focus if another message window is already active |
| 829 | | const QWidget* activeWin = QApplication::activeWindow(); |
| 830 | | if (activeWin != NULL && ((qobject_cast<const UserEventCommon*>(activeWin)) != NULL || |
| 831 | | (qobject_cast<const UserEventTabDlg*>(activeWin)) != NULL)) |
| 832 | | activateMsgwin = false; |
| | 825 | // Focus the new window/tab after showing it |
| | 826 | bool activateMsgwin = true; |
| | 827 | |
| | 828 | if (autoPopup) |
| | 829 | { |
| | 830 | // Message is triggered by auto-popup (and not by user) so check if it |
| | 831 | // really should be activated |
| | 832 | activateMsgwin = Config::Chat::instance()->autoFocus(); |
| | 833 | |
| | 834 | // Don't change focus if another message window is already active |
| | 835 | const QWidget* activeWin = QApplication::activeWindow(); |
| | 836 | if (activeWin != NULL && ((qobject_cast<const UserEventCommon*>(activeWin)) != NULL || |
| | 837 | (qobject_cast<const UserEventTabDlg*>(activeWin)) != NULL)) |
| | 838 | activateMsgwin = false; |
| | 839 | } |