Changeset 432 for trunk/src/gui/util/qsystemtrayicon_pm.cpp
- Timestamp:
- Dec 18, 2009, 2:36:30 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/util/qsystemtrayicon_pm.cpp
r286 r432 158 158 } 159 159 160 static void closeNormalPopups() 161 { 162 if (QApplication::activePopupWidget()) { 163 // The system tray area is actually another application so we close all 164 // normal popups for consistency (see qapplication_pm.cpp). In case some 165 // popup refuses to close, we give up after 1024 attempts (to avoid an 166 // infinite loop). 167 int maxiter = 1024; 168 QWidget *popup; 169 while ((popup = QApplication::activePopupWidget()) && maxiter--) 170 popup->close(); 171 } 172 } 173 160 174 bool QSystemTrayIconSys::pmEvent(QMSG *msg, MRESULT *result) 161 175 { … … 165 179 switch (SHORT2FROMMP(msg->mp1)) { 166 180 case XST_IN_MOUSE: { 181 closeNormalPopups(); 167 182 PXSTMOUSEMSG pMsg = (PXSTMOUSEMSG)msg->mp2; 168 183 switch (pMsg->ulMouseMsg) { … … 182 197 } 183 198 case XST_IN_CONTEXT: { 199 closeNormalPopups(); 200 if (QApplication::activePopupWidget()) { 201 // The system tray area is actually another application 202 // so we close all normal popups for consistency (see 203 // qapplication_pm.cpp). In case some popup refuses to 204 // close, we give up after 1024 attempts (to avoid an 205 // infinite loop). 206 int maxiter = 1024; 207 QWidget *popup; 208 while ((popup=QApplication::activePopupWidget()) && maxiter--) 209 popup->close(); 210 } 184 211 PXSTCONTEXTMSG pMsg = (PXSTCONTEXTMSG)msg->mp2; 185 212 if (q->contextMenu()) { … … 196 223 break; 197 224 } 225 case XST_IN_WHEEL: { 226 closeNormalPopups(); 227 } 198 228 default: 199 229 break;
Note:
See TracChangeset
for help on using the changeset viewer.