- Timestamp:
- Nov 13, 2006, 12:05:13 AM (19 years ago)
- Location:
- trunk/src/kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel/qapplication_pm.cpp
r139 r153 1799 1799 // get the modal widget that made this window blocked 1800 1800 QWidget *m = 1801 (QWidget*) WinQueryWindow ULong( widget->winId(), QWL_QTMODAL );1801 (QWidget*) WinQueryWindowPtr( widget->winId(), QWL_QTMODAL ); 1802 1802 if( m ) { 1803 1803 if ( swp.fl & SWP_ACTIVATE ) { … … 1970 1970 } 1971 1971 QWidget *blockedBy = 1972 (QWidget*) WinQueryWindow ULong( w->winId(), QWL_QTMODAL );1972 (QWidget*) WinQueryWindowPtr( w->winId(), QWL_QTMODAL ); 1973 1973 if ( blocked ) { 1974 1974 // stop sending on alreay blocked widgets … … 1980 1980 return; 1981 1981 } 1982 WinSetWindowULong( w->winId(), QWL_QTMODAL, 1983 blocked ? (ULONG) modal : 0 ); 1982 WinSetWindowPtr( w->winId(), QWL_QTMODAL, blocked ? modal : NULL ); 1984 1983 WinEnableWindow( w->winFId(), !blocked ); 1985 1984 } … … 1993 1992 while( ( o = it.current() ) != 0 ) { 1994 1993 ++it; 1995 qt_sendBlocked( o, modal, e, FALSE );1994 qt_sendBlocked( o, modal, e, blocked ? FALSE : TRUE ); 1996 1995 } 1997 1996 } … … 2017 2016 QEvent e( blocked ? QEvent::WindowBlocked : QEvent::WindowUnblocked ); 2018 2017 2018 if ( !blocked ) { 2019 // For unblocking, we go through all top-level widgets and unblock 2020 // those that have been blocked by the given modal widget. It means that 2021 // we don't select widgets to unblock based on widget flags (as we do 2022 // below when blocking) because these flags might have been changed 2023 // so that we could skip widgets that we would have to unblock. Although 2024 // normally widget flags should never be changed after widget creation 2025 // (except that by QWidget::reparentSys() that takes blocking into 2026 // account and corrects it as needed), nothing stops one from doing so, 2027 // leading to a case when the QWL_QTMODAL word of some widget still 2028 // points to a widget that has been deleted (so that any attempt to 2029 // access it results into a nasty segfault). 2030 QWidgetList *list = QApplication::topLevelWidgets(); 2031 for( QWidget *w = list->first(); w; w = list->next() ) { 2032 if ( WinQueryWindowPtr( w->winId(), QWL_QTMODAL ) == modal ) 2033 qt_sendBlocked( w, modal, &e, TRUE ); 2034 } 2035 delete list; 2036 return; 2037 } 2038 2019 2039 // find the modal's group leader 2020 2040 QWidget *mgl = modal->parentWidget(); … … 2030 2050 for( QWidget *w = list->first(); w; w = list->next() ) { 2031 2051 if ( 2032 !w->isDesktop() && !w->isPopup() && !w->isHidden() &&2052 !w->isDesktop() && !w->isPopup() && 2033 2053 !w->testWFlags( Qt::WGroupLeader ) && 2034 2054 (!w->parentWidget() || w->parentWidget()->isDesktop()) … … 2045 2065 // qt_tryModalHelper() also assumes that the toppest modal widget blocks 2046 2066 // other modals, regardless of WGroupLeader flags in parents. do the same. 2047 // note: the given modal is not yet at the stack here.2067 // Note: the given modal is not yet at the stack here. 2048 2068 if ( qt_modal_stack ) { 2049 2069 QWidget *m = qt_modal_stack->first(); -
trunk/src/kernel/qwidget_pm.cpp
r135 r153 941 941 */ 942 942 943 // strictly speaking, PM is not obliged to initialize window data 944 // with zeroes (although seems to), so do it ourselves 945 for ( LONG i = 0; i <= QT_EXTRAWINDATASIZE - 4; i += 4 ) 946 WinSetWindowULong( id, i, 0 ); 947 943 948 // When the FS_SHELLPOSITION flag is specified during WC_FRAME window 944 949 // creation its size and position remains zero until it is shown … … 1083 1088 QWidget *blockedBy = 0; 1084 1089 if ( isTopLevel() ) 1085 blockedBy = (QWidget*) WinQueryWindow ULong( winId(), QWL_QTMODAL );1090 blockedBy = (QWidget*) WinQueryWindowPtr( winId(), QWL_QTMODAL ); 1086 1091 if ( !blockedBy && parentWidget() ) 1087 blockedBy = (QWidget*) WinQueryWindow ULong(1092 blockedBy = (QWidget*) WinQueryWindowPtr( 1088 1093 parentWidget()->topLevelWidget()->winId(), QWL_QTMODAL ); 1089 1094 if ( blockedBy ) { … … 1151 1156 blockedBy = 0; 1152 1157 if ( parentWidget() ) 1153 blockedBy = (QWidget*) WinQueryWindow ULong(1158 blockedBy = (QWidget*) WinQueryWindowPtr( 1154 1159 parentWidget()->topLevelWidget()->winId(), QWL_QTMODAL ); 1155 1160 if ( blockedBy ) {
Note:
See TracChangeset
for help on using the changeset viewer.