- Timestamp:
- Aug 4, 2011, 12:42:23 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/kernel/qapplication_pm.cpp
r786 r936 143 143 QWidgetPrivate *dptr() { return d_func(); } 144 144 QRect frameStrut() const { return d_func()->frameStrut(); } 145 HWND frameWinId() const { return d_func()->frameWinId(); } 145 146 bool pmEvent(QMSG *m, MRESULT *r) { return QWidget::pmEvent(m, r); } 146 147 // void markFrameStrutDirty() { data->fstrut_dirty = 1; } … … 1102 1103 // FID_SYSMENU) should not cause the focus to be lost. 1103 1104 if (WinQueryWindow(hwnd, QW_OWNER) == 1104 ((QETWidget*)widget->window())-> dptr()->frameWinId())1105 ((QETWidget*)widget->window())->frameWinId()) 1105 1106 break; 1106 1107 if (!widget->isWindow()) … … 1311 1312 } 1312 1313 1314 case WM_ADJUSTWINDOWPOS: { 1315 // If PM tries to activate a modally blocked window, pass activation 1316 // 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). 1322 PSWP pswp =(PSWP)qmsg.mp1; 1323 if (app_do_modal && 1324 ((pswp->fl & SWP_ACTIVATE) || (pswp->fl & SWP_ZORDER))) { 1325 QWidget *top = 0; 1326 if (!QApplicationPrivate::tryModalHelper(widget, &top) && top && widget != top) { 1327 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 } 1337 pswp->fl &= ~SWP_ACTIVATE; 1338 } 1339 if (pswp->fl & SWP_ZORDER) { 1340 pswp->fl &= ~SWP_ZORDER; 1341 } 1342 } 1343 } 1344 break; 1345 } 1346 1313 1347 case WM_QUERYTRACKINFO: { 1314 1348 QWExtra *x = widget->xtra(); … … 1439 1473 ignoreNextMouseReleaseEvent = false; 1440 1474 1441 // go through all top-level widgets and disable those that should be 1442 // b locked by the modality (this in particular will disable activation1443 // through clicking on the title bar and also state change throuhg titlebar1444 // buttons)1475 // go through all top-level widgets and disable those that should be blocked 1476 // by the modality (this will effectively disable frame controls and make 1477 // it impossible to manipulate the window state, position and size, even 1478 // programmatically, e.g. from the Window List) 1445 1479 QWidgetList list = QApplication::topLevelWidgets(); 1446 1480 foreach(QWidget *w, list) { 1447 if ( QApplicationPrivate::isBlockedByModal(w))1481 if (w != widget && QApplicationPrivate::isBlockedByModal(w)) { 1448 1482 WinEnableWindow(w->d_func()->frameWinId(), FALSE); 1483 } 1449 1484 } 1450 1485 } … … 1453 1488 { 1454 1489 if (qt_modal_stack) { 1455 // go through all affected top-level widgets and re-enable them1456 QWidgetList list = QApplication::topLevelWidgets();1457 foreach(QWidget *w, list) {1458 if (QApplicationPrivate::isBlockedByModal(w))1459 WinEnableWindow(w->d_func()->frameWinId(), TRUE);1460 }1461 1490 if (qt_modal_stack->removeAll(widget)) { 1462 1491 if (qt_modal_stack->isEmpty()) { … … 1480 1509 } 1481 1510 ignoreNextMouseReleaseEvent = true; 1511 1512 // go through all top-level widgets and re-enable those that are not 1513 // blocked any more 1514 QWidgetList list = QApplication::topLevelWidgets(); 1515 foreach(QWidget *w, list) { 1516 if (w != widget && !QApplicationPrivate::isBlockedByModal(w)) { 1517 WinEnableWindow(w->d_func()->frameWinId(), TRUE); 1518 } 1519 } 1482 1520 } 1483 1521 app_do_modal = qt_modal_stack != 0; … … 2732 2770 myCaseEnd() 2733 2771 2772 myCaseBegin(WM_ADJUSTWINDOWPOS) 2773 debug << *((PSWP) qmsg.mp1); 2774 debug.space(); 2775 break; 2776 myCaseEnd() 2777 2734 2778 myCaseBegin(WM_WINDOWPOSCHANGED) 2735 2779 debug << *((PSWP) qmsg.mp1); … … 2785 2829 myCaseEnd() 2786 2830 2787 myCaseBegin(WM_ADJUSTWINDOWPOS)2788 break;2789 myCaseEnd()2790 2791 2831 myCaseBegin(WM_VRNDISABLED) 2792 2832 break; … … 2797 2837 2798 2838 myCaseBegin(WM_SHOW) 2839 break; 2840 myCaseEnd() 2841 2842 myCaseBegin(WM_HITTEST) 2843 PPOINTS pt = (PPOINTS)&qmsg.mp1; 2844 debug.nospace() << "Point(" << pt->x << "," << pt->y << ")"; 2845 debug.space(); 2799 2846 break; 2800 2847 myCaseEnd()
Note:
See TracChangeset
for help on using the changeset viewer.