Changeset 6145 for trunk/qt4-gui/src/core/licqgui.cpp
- Timestamp:
- 04/12/08 21:25:28 (8 months ago)
- Files:
-
- 1 modified
-
trunk/qt4-gui/src/core/licqgui.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt4-gui/src/core/licqgui.cpp
r6143 r6145 870 870 return NULL; 871 871 872 // Check if a message window should be made active 873 bool activateMsgwin = Config::Chat::instance()->autoFocus(); 874 875 // Don't change focus if another message window is already active 876 const QWidget* activeWin = QApplication::activeWindow(); 877 if (activeWin != NULL && ((qobject_cast<const UserEventCommon*>(activeWin)) != NULL || 878 (qobject_cast<const UserEventTabDlg*>(activeWin)) != NULL)) 879 activateMsgwin = false; 880 872 881 if (Config::Chat::instance()->msgChatView()) 873 882 { … … 886 895 // e->convoJoin(id); 887 896 888 if (myUserEventTabDlg && myUserEventTabDlg->tabExists(e)) 897 QWidget* msgWindow = e; 898 if (myUserEventTabDlg != NULL && myUserEventTabDlg->tabExists(e)) 889 899 { 890 myUserEventTabDlg->show(); 891 if (Config::Chat::instance()->autoFocus()) 892 { 900 msgWindow = myUserEventTabDlg; 901 if (activateMsgwin) 893 902 myUserEventTabDlg->selectTab(e); 894 myUserEventTabDlg->raise();895 myUserEventTabDlg->activateWindow();896 }897 903 } 898 else 904 905 msgWindow->show(); 906 msgWindow->setWindowState(msgWindow->windowState() & ~Qt::WindowMinimized); 907 if (activateMsgwin) 899 908 { 900 e->show(); 901 if (Config::Chat::instance()->autoFocus() && 902 (!qApp->activeWindow() || !qApp->activeWindow()->inherits("UserEventCommon"))) 903 { 904 e->raise(); 905 e->activateWindow(); 906 } 909 // FIXME: When restoring from minimized, the window isn't activated (at least not on KDE) 910 msgWindow->raise(); 911 msgWindow->activateWindow(); 907 912 } 913 908 914 // Make the existing event dialog change to the new event type 909 915 e->changeEventType(fcn); … … 917 923 if (Config::Chat::instance()->tabbedChatting()) 918 924 { 919 if (myUserEventTabDlg != NULL) 920 { 921 if (Config::Chat::instance()->autoFocus()) 922 { 923 myUserEventTabDlg->raise(); 924 myUserEventTabDlg->activateWindow(); 925 } 926 } 927 else 925 if (myUserEventTabDlg == NULL) 928 926 { 929 927 // create the tab dialog if it does not exist … … 970 968 connect(e, SIGNAL(viewUrl(QWidget*, QString)), SLOT(viewUrl(QWidget*, QString))); 971 969 970 QWidget* msgWindow = e; 972 971 if (Config::Chat::instance()->tabbedChatting()) 973 972 { 973 msgWindow = myUserEventTabDlg; 974 974 975 myUserEventTabDlg->addTab(e); 975 myUserEventTabDlg->show(); 976 if (newtabw) 977 e->setFocus(); 978 979 if (Config::Chat::instance()->autoFocus()) 980 { 981 myUserEventTabDlg->raise(); 982 myUserEventTabDlg->activateWindow(); 983 } 976 if (activateMsgwin) 977 myUserEventTabDlg->selectTab(e); 984 978 985 979 // Check if we want the window sticky … … 987 981 QTimer::singleShot(100, myUserEventTabDlg, SLOT(slotSetMsgWinSticky())); 988 982 } 989 else 990 e->show(); 983 984 // FIXME: New windows always become active stealing focus from other event windows (at least on KDE) 985 msgWindow->show(); 986 msgWindow->setWindowState(msgWindow->windowState() & ~Qt::WindowMinimized); 987 if (activateMsgwin) 988 { 989 // FIXME: When restoring from minimized, the window isn't activated (at least not on KDE) 990 msgWindow->raise(); 991 msgWindow->activateWindow(); 992 } 991 993 992 994 // there might be more than one send window open
