Changeset 75


Ignore:
Timestamp:
Mar 26, 2006, 8:14:05 PM (19 years ago)
Author:
dmik
Message:

Added the PWO_TopLevel flag for qt_WinProcessWindowObstacles(): it tells to include top-level windows (children of the desktop) to the set of clipped out windows, which is necessary when moving ot scrolling windows (copies of parts of overlying top-level windows were left on the screen).

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/qwidget.h

    r64 r75  
    601601#if !defined (QT_PM_NO_WIDGETMASK)
    602602    void validateObstacles();
    603     LONG combineObstacles( HRGN hrgn, LONG op );
    604603#endif   
    605604    enum ClipMode { ClipDefault, Unclipped, ClipAll };
  • trunk/src/kernel/qwidget_pm.cpp

    r64 r75  
    109109}
    110110
     111/** \internal flags for qt_WinProcessWindowObstacles() */
    111112enum {
    112113    PWO_Children = 0x01,
    113114    PWO_Sibings = 0x02,
    114115    PWO_Ancestors = 0x04,
    115     PWO_All = PWO_Children | PWO_Sibings | PWO_Ancestors,
     116    PWO_TopLevel = 0x80000000,
     117    // PWO_Default is suitable in most cases (for simple paint operations)
     118    PWO_Default = PWO_Children | PWO_Sibings | PWO_Ancestors,
    116119};
    117120
     
    226229 */
    227230static LONG qt_WinProcessWindowObstacles( HWND hwnd, PRECTL prcl, HRGN hrgn,
    228                                           LONG op, LONG flags = PWO_All )
     231                                          LONG op, LONG flags = PWO_Default )
    229232{
    230233    Q_ASSERT( hwnd );
     
    336339        while ( parent != desktop ) {
    337340            HWND grandParent = WinQueryWindow( parent, QW_PARENT );
    338             // no need to clip top-level windows (that cannot be non-rectangular
    339             // and thus are always correctly clipped by the system)
    340             if ( grandParent == desktop )
    341                 break;
     341            if ( !(flags & PWO_TopLevel) ) {
     342                // When PWO_TopLevel is not specified, top-level windows
     343                // (children of the desktop) are not processed. It makes sense
     344                // when qt_WinProcessWindowObstacles() is used to clip out
     345                // overlying windows during regular paint operations (WM_PAINT
     346                // processing or drawing in a window directly through
     347                // WinGetPS()): in this case, top-level windows are always
     348                // correctly clipped out by the system (because they cannot be
     349                // non-rectangular).
     350                if ( grandParent == desktop )
     351                    break;
     352            }
    342353           
    343354            WinQueryWindowPos( parent, &swp );
     
    837848#endif
    838849            // note that we place the client on top (HWND_TOP) to exclude other
    839             // frame controls from being analysed in qt_WinProcessWindowObstacles
     850            // frame controls from being analyzed in qt_WinProcessWindowObstacles
    840851            id = WinCreateWindow(
    841852                    fId, pszClassName, title, style, 0, 0, 0, 0,
     
    18651876                HRGN hrgnObst = GpiCreateRegion( hps, 0, NULL );
    18661877                qt_WinProcessWindowObstacles( winId(), &rclAff, hrgnObst, CRGN_OR,
    1867                                               PWO_Sibings | PWO_Ancestors );
     1878                                              PWO_Sibings | PWO_Ancestors |
     1879                                              PWO_TopLevel );
    18681880                // shift region of obstacles and affected region back to
    18691881                // parent coords
     
    23122324    }
    23132325   
    2314     int pwoFlags = PWO_Ancestors | PWO_Sibings;
     2326    int pwoFlags = PWO_Ancestors | PWO_Sibings | PWO_TopLevel;
    23152327    if ( clip )
    23162328        pwoFlags |= PWO_Children;
     
    27582770}
    27592771
    2760 /*!
    2761  *  \internal
    2762  *
    2763  *  Combines areas of this widget covered by (intersected with) its children
    2764  *  and sibling widgets to a region \a hrgn using an operation \a op
    2765  *  (see GpiCombineRegion()). Returns the complexity of the combined region.
    2766  *
    2767  *  Clip regions of all relative widgets (set by WinSetClipRegion()) are taken
    2768  *  into account.
    2769  */
    2770 /// @todo (dmik) is it really necessary somewhere?
    2771 LONG QWidget::combineObstacles( HRGN hrgn, LONG op )
    2772 {
    2773     return qt_WinProcessWindowObstacles( winId(), NULL, hrgn, op );
    2774 }
    2775 
    27762772#endif // !defined (QT_PM_NO_WIDGETMASK)
    27772773
Note: See TracChangeset for help on using the changeset viewer.