Ignore:
Timestamp:
Jul 30, 2006, 7:11:51 PM (19 years ago)
Author:
dmik
Message:

Widgets: Implemented QDesktopWidget::availableGeometry().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel/qapplication_pm.cpp

    r109 r110  
    951951//
    952952
    953 // some undocumented messages (they have the WM_U_ prefix for clarity)
    954 //@@TODO (dmik): are they all available in Warp3?
    955953enum {
     954    // some undocumented messages (they have the WM_U_ prefix for clarity)
     955   
    956956    // sent to hwnd that has been entered to by a mouse pointer.
    957957    // FID_CLIENT also receives enter messages of its WC_FRAME.
     
    962962    // mp1 = hwnd that is left, mp2 = hwnd that is entered
    963963    WM_U_MOUSELEAVE = 0x41F,
     964
     965    // some undocumented system values
     966   
     967    SV_WORKAREA_YTOP = 51,           
     968    SV_WORKAREA_YBOTTOM = 52,           
     969    SV_WORKAREA_XRIGHT = 53,           
     970    SV_WORKAREA_XLEFT = 54,
    964971};
    965972
     
    10801087#endif
    10811088
    1082 /// @todo (dmik) later
    1083 //    case WM_SETTINGCHANGE:
    1084 //#ifdef Q_OS_TEMP
    1085 //      // CE SIP hide/show
    1086 //      if ( wParam == SPI_SETSIPINFO ) {
    1087 //          QResizeEvent re( QSize(0, 0), QSize(0, 0) ); // Calculated by QDesktopWidget
    1088 //          QApplication::sendEvent( qt_desktopWidget, &re );
    1089 //          break;
    1090 //      }
    1091 //#endif
    1092 //      // ignore spurious XP message when user logs in again after locking
    1093 //      if ( qApp->type() == QApplication::Tty )
    1094 //          break;
    1095 //      if ( QApplication::desktopSettingsAware() && wParam != SPI_SETWORKAREA ) {
    1096 //          widget = (QETWidget*)QWidget::find( hwnd );
    1097 //          if ( widget ) {
    1098 //              widget->markFrameStrutDirty();
    1099 //              if ( !widget->parentWidget() )
    1100 //                  qt_set_windows_resources();
    1101 //          }
    1102 //      }
    1103 //      break;
    1104 //    case WM_SYSCOLORCHANGE:
    1105 //      if ( qApp->type() == QApplication::Tty )
    1106 //          break;
    1107 //      if ( QApplication::desktopSettingsAware() ) {
    1108 //          widget = (QETWidget*)QWidget::find( hwnd );
    1109 //          if ( widget && !widget->parentWidget() )
    1110 //              qt_set_windows_resources();
    1111 //      }
    1112 //      break;
     1089        case WM_SYSVALUECHANGED: {
     1090            // This message is sent to all top-level widgets, handle only once
     1091            QWidgetList *list = QApplication::topLevelWidgets();
     1092            bool firstWidget = list->first()->winId() == hwnd;
     1093            delete list;
     1094            if ( !firstWidget )
     1095                break;
     1096            LONG from = (LONG) mp1;
     1097            LONG to = (LONG) mp2;
     1098            #define _IS_SV(sv) (from >= (sv) && to <= (sv))
     1099            if ( _IS_SV( SV_WORKAREA_XLEFT ) || _IS_SV( SV_WORKAREA_XRIGHT ) ||
     1100                 _IS_SV( SV_WORKAREA_YBOTTOM ) || _IS_SV( SV_WORKAREA_YTOP ) ) {
     1101                 // send a special invalid resize event to QDesktopWidget
     1102                 QResizeEvent re( QSize( -1, -1 ), QSize( -1, -1 ) );
     1103                 QApplication::sendEvent( qt_desktopWidget, &re );
     1104                 /// @todo (dmik) enumerate all top-level widgets and
     1105                 //  remaximize those that are maximized
     1106            } else {
     1107                 /// @todo (dmik) call qt_set_pm_resources() in the way it is
     1108                 //  done in WM_SYSCOLORCHANGE for relevant SV_ values.
     1109            }
     1110            #undef _IS_SV
     1111            break;
     1112        }
     1113
     1114        case WM_SYSCOLORCHANGE: {
     1115            // This message is sent to all top-level widgets, handle only once
     1116            QWidgetList *list = QApplication::topLevelWidgets();
     1117            bool firstWidget = list->first()->winId() == hwnd;
     1118            delete list;
     1119            if ( !firstWidget )
     1120                break;
     1121            if ( qApp->type() == QApplication::Tty )
     1122                break;
     1123            if ( QApplication::desktopSettingsAware() ) {
     1124                widget = (QETWidget*)QWidget::find( hwnd );
     1125                if ( widget && !widget->parentWidget() )
     1126                    qt_set_pm_resources();
     1127            }
     1128            break;
     1129        }
    11131130
    11141131        case WM_BUTTON1DOWN:
     
    20122029        }
    20132030    }
     2031    delete list;
    20142032
    20152033    if ( mgl ) {
Note: See TracChangeset for help on using the changeset viewer.