- Timestamp:
- Aug 4, 2011, 8:42:53 PM (14 years ago)
- Location:
- trunk/src/gui/kernel
- Files:
-
- 3 edited
-
qapplication_pm.cpp (modified) (5 diffs)
-
qwidget_p.h (modified) (3 diffs)
-
qwidget_pm.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/kernel/qapplication_pm.cpp
r936 r938 144 144 QRect frameStrut() const { return d_func()->frameStrut(); } 145 145 HWND frameWinId() const { return d_func()->frameWinId(); } 146 146 147 bool pmEvent(QMSG *m, MRESULT *r) { return QWidget::pmEvent(m, r); } 147 148 // void markFrameStrutDirty() { data->fstrut_dirty = 1; } … … 1268 1269 } 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1270 1285 PFNWP QtOldFrameProc = 0; 1271 1286 1272 1287 MRESULT EXPENTRY QtFrameProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 1273 1288 { 1289 1290 1274 1291 do { 1275 1292 if (!qApp) // unstable app state … … 1315 1332 // If PM tries to activate a modally blocked window, pass activation 1316 1333 // over to the top modal window instead of letting it activate the 1317 // blocked one. Z-order changes are simply ignored for now. 1318 // @todo Blocked widgets should keep Z-order WRT their modal 1319 // blockers whenever they move (e.g. bringing the modal one to top 1320 // should also put the one it blocks right under it instead of 1321 // possibly leaving it somewhere behind other windows). 1334 // blocked one 1322 1335 PSWP pswp =(PSWP)qmsg.mp1; 1323 1336 if (app_do_modal && 1324 1337 ((pswp->fl & SWP_ACTIVATE) || (pswp->fl & SWP_ZORDER))) { 1325 Q Widget *top = 0;1326 if ( !QApplicationPrivate::tryModalHelper(widget, &top) && top && widget != top) {1338 Q; 1339 if () { 1327 1340 if (pswp->fl & SWP_ACTIVATE) { 1328 if (top->isVisible()) { 1329 top->activateWindow(); 1330 } else { 1331 // This is the case when native file dialogs are shown 1332 QWidget *p = (top->parentWidget() ? top->parentWidget()->window() : 0); 1333 if (p && p->isVisible()) { 1334 p->activateWindow(); 1335 } 1336 } 1341 // find the blocker that isn't blocked itself and 1342 // delegate activation to it (WM_WINDOWPOSCHANGED will 1343 // care about the rest) 1344 while (above->modalBlocker()) 1345 above = above->modalBlocker(); 1346 WinSetWindowPos(above->frameWinId(), HWND_TOP, 0, 0, 0, 0, 1347 SWP_ACTIVATE | SWP_ZORDER); 1337 1348 pswp->fl &= ~SWP_ACTIVATE; 1338 1349 } 1339 1350 if (pswp->fl & SWP_ZORDER) { 1340 pswp->fl &= ~SWP_ZORDER; 1351 // forbid changing the Z-order of the blocked widget 1352 // (except when it is moved right under its blocker) 1353 if (pswp->hwndInsertBehind != above->frameWinId()) 1354 pswp->fl &= ~SWP_ZORDER; 1341 1355 } 1342 1356 } 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1343 1371 } 1344 1372 break; … … 1478 1506 // programmatically, e.g. from the Window List) 1479 1507 QWidgetList list = QApplication::topLevelWidgets(); 1480 foreach (QWidget *w, list) {1508 foreach(QWidget *w, list) { 1481 1509 if (w != widget && QApplicationPrivate::isBlockedByModal(w)) { 1482 WinEnableWindow(w->d_func()->frameWinId(), FALSE); 1510 if (!w->d_func()->modalBlocker()) { 1511 WinEnableWindow(w->d_func()->frameWinId(), FALSE); 1512 // also remember the blocker widget so that the blocked one can 1513 // pass activation attempts to it (note that the blocker is not 1514 // necessarily modal itself, it's just the window right above 1515 // the one being blocked, we will use this to restore z-order of 1516 // of blocked widgets in qt_pull_blocked_widgets()) 1517 QWidget *widgetAbove = 0; 1518 HWND above = w->d_func()->frameWinId(); 1519 while (!widgetAbove) { 1520 above = WinQueryWindow(above, QW_PREV); 1521 if (!above) 1522 break; 1523 widgetAbove = qt_widget_from_hwnd(above); 1524 } 1525 if (!widgetAbove) 1526 widgetAbove = widget; 1527 w->d_func()->setModalBlocker(widgetAbove); 1528 } 1483 1529 } 1484 1530 } … … 1515 1561 foreach(QWidget *w, list) { 1516 1562 if (w != widget && !QApplicationPrivate::isBlockedByModal(w)) { 1517 WinEnableWindow(w->d_func()->frameWinId(), TRUE); 1563 if (w->d_func()->modalBlocker()) { 1564 w->d_func()->setModalBlocker(0); 1565 WinEnableWindow(w->d_func()->frameWinId(), TRUE); 1566 } 1518 1567 } 1519 1568 } -
trunk/src/gui/kernel/qwidget_p.h
r878 r938 236 236 HSWITCH swEntry; 237 237 HPOINTER iconPointer; 238 238 239 #endif 239 240 }; … … 782 783 uint noPaintOnScreen : 1; // see qwidget_pm.cpp ::paintEngine() 783 784 784 inline HWND frameWinId() const 785 { return maybeTopData() && maybeTopData()->fId != NULLHANDLE ? 786 maybeTopData()->fId : data.winid; } 785 inline HWND frameWinId() const; 787 786 HWND effectiveFrameWinId() const; 788 787 void validateObstacles(); 789 788 void reparentChildren(); 789 790 790 791 #elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN 791 792 uint noPaintOnScreen : 1; // see qwidget_win.cpp ::paintEngine() … … 1016 1017 } 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1018 1040 QT_END_NAMESPACE 1019 1041 -
trunk/src/gui/kernel/qwidget_pm.cpp
r809 r938 2383 2383 extra->topextra->swEntry = NULLHANDLE; 2384 2384 extra->topextra->iconPointer = NULLHANDLE; 2385 2385 2386 } 2386 2387 2387 2388 void QWidgetPrivate::deleteTLSysExtra() 2388 2389 { 2390 2389 2391 if (extra->topextra->iconPointer != NULLHANDLE) 2390 2392 WinDestroyPointer(extra->topextra->iconPointer);
Note:
See TracChangeset
for help on using the changeset viewer.
