Ignore:
Timestamp:
Aug 29, 2011, 1:43:52 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

OS/2: Disable native window masking code as it is not complete.

This code is only necessary for child widgets that have native windows.
Applications using this approach are very rare (they include e.g. video
players that paint to Qt widgets on their own using native window IDs)
and they don't need masking in these widgets or their ancestors anyway.

The current implementation lacks some functionality -- in particular, it
cannot properly issue WM_VRNENABLED/WM_VRNDISABLED notifications
which breaks those video players, so that keeping it enabled makes little
to no sense.

The relevant code remains in place but guarded by the
QT_PM_NATIVEWIDGETMASK compiler macro so that it can be enabled
as needed for further experiments. See also #203 for more details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/kernel/qwidget_pm.cpp

    r1019 r1034  
    7575extern MRESULT EXPENTRY QtFrameCtlProc(HWND, ULONG, MPARAM, MPARAM);
    7676
     77#ifndef QT_PM_NATIVEWIDGETMASK
     78#define qt_WinSetWindowPos WinSetWindowPos
     79#endif
     80
    7781#if !defined(QT_NO_SESSIONMANAGER)
    7882bool qt_about_to_destroy_wnd = false;
     
    114118    // this function -- it is done automatically upon process termination.
    115119}
     120
     121#ifdef QT_PM_NATIVEWIDGETMASK
    116122
    117123/*!
     
    231237
    232238/*!
     239    \internal
     240
    233241    \enum PWOFlags
    234242    \relates QWidget
     
    249257
    250258/*!
     259    \internal
     260
    251261    \fn LONG qt_WinProcessWindowObstacles(HWND hwnd, RECTL *prcl, HRGN hrgn,
    252262                                          LONG op, LONG flags)
     
    511521                               ULONG fl)
    512522{
     523    // @todo We need to send WM_VRNENABLED/WM_VRNDISABLED to all affected
     524    // windows as it turned out that WinSetWindowPos() called with SWP_NOREDRAW
     525    // does not do that. The problem here is that it's unknown how to determine
     526    // which windows asked to send them visible region change notifications with
     527    // WinSetVisibleRegionNotify(). This is the main reason why we do not define
     528    // QT_PM_NATIVEWIDGETMASK by default. Not sending those notifications breaks
     529    // painting to widgets that depend on this information, e.g. all direct
     530    // painting modes using DIVE. Note that this only affects cases when native
     531    // windows are created for child widgets. Normally, this is not the case,
     532    // all masking is done by Qt and this code is not involved at all, so
     533    // disabling it doesn't affect applications.
     534
    513535#if defined(QT_DEBUGWIDGETMASK)
    514536    qDebug() << "qt_WinSetWindowPos: hwnd" << qDebugHWND(hwnd)
     
    843865}
    844866
     867#endif // QT_PM_NATIVEWIDGETMASK
     868
    845869/*!
    846870    \internal
     
    850874    hrgn. hps is the presentation space of hrgn.
    851875 */
    852 void qt_WinExcludeOverlappingWindows(HWND hwnd, HPS hps, HRGN hrgn)
     876static void qt_WinExcludeOverlappingWindows(HWND hwnd, HPS hps, HRGN hrgn)
    853877{
    854878    HRGN vr = GpiCreateRegion(hps, 0, NULL);
     
    882906    all clip coordinates are inclusive.
    883907 */
    884 void qt_WinScrollWindowWell(HWND hwnd, LONG dx, LONG dy, const PRECTL clip = NULL)
     908static void qt_WinScrollWindowWell(HWND hwnd, LONG dx, LONG dy,
     909                                   const PRECTL clip = NULL)
    885910{
    886911    WinLockVisRegions(HWND_DESKTOP, TRUE);
     
    11031128        // problems with this line enabled in Qt3 on OS/2 in QT_PM_NO_WIDGETMASK
    11041129        // mode (terrible flicker in QFileDialog because QSplitter used there
    1105         // sets WA_PaintUnclipped). This however doesn't make a big difference
    1106         // now since we don't support QT_PM_NO_WIDGETMASK anymore (read below
    1107         // about clipping) and is left here just to show where WA_PaintUnclipped
    1108         // was originally intended to be used.
     1130        // sets WA_PaintUnclipped). Note that in QT_PM_NATIVEWIDGETMASK mode it
     1131        // doesn't play any role since all clipping is manually done by us
     1132        // anyway (see below).
    11091133#if 0
    11101134        if (!testAttribute(Qt::WA_PaintUnclipped))
    11111135#endif
    11121136        {
     1137#ifdef QT_PM_NATIVEWIDGETMASK
    11131138            // We don't use WS_CLIPSIBLINGS and WS_CLIPCHILDREN because when these
    11141139            // styles are set and the child (sibling) window has a non-NULL clip region,
     
    11231148            if (topLevel)
    11241149                style |= WS_CLIPSIBLINGS;
     1150#else
     1151                style |= WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
     1152#endif
    11251153        }
    11261154
     
    24882516void QWidgetPrivate::setMask_sys(const QRegion &region)
    24892517{
     2518#ifdef QT_PM_NATIVEWIDGETMASK
    24902519    // @todo implement
     2520#endif
    24912521}
    24922522
     
    25672597}
    25682598
     2599#ifdef QT_PM_NATIVEWIDGETMASK
     2600
    25692601/*!
    25702602    \internal
     
    25902622}
    25912623
     2624#endif // QT_PM_NATIVEWIDGETMASK
     2625
    25922626QT_END_NAMESPACE
Note: See TracChangeset for help on using the changeset viewer.