Changeset 1034 for trunk/src


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.

Location:
trunk/src/gui
Files:
6 edited

Legend:

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

    r1009 r1034  
    123123extern QCursor *qt_grab_cursor();
    124124
     125
    125126extern void qt_WinQueryClipRegionOrRect(HWND hwnd, HRGN hrgn); // qwidget_pm.cpp
     127
    126128
    127129extern bool qt_sendSpontaneousEvent(QObject*, QEvent*); // qapplication.cpp
     
    11911193                        }
    11921194                        if (!dispatch) {
     1195
    11931196                            HPS hps = qt_display_ps();
    11941197                            HRGN hrgn = GpiCreateRegion(hps, 0, NULL);
     
    11991202                            dispatch = !GpiPtInRegion(hps, hrgn, &pt);
    12001203                            GpiDestroyRegion(hps, hrgn);
     1204
     1205
     1206
     1207
     1208
    12011209                        }
    12021210                    }
     
    23262334    HPS displayPS = qt_display_ps();
    23272335
     2336
    23282337    // Since we don't use WS_CLIPSIBLINGS and WS_CLIPCHILDREN bits (see
    23292338    // qwidget_pm.cpp), we have to validate areas that intersect with our
    23302339    // children and siblings, taking their clip regions into account.
    23312340    d_func()->validateObstacles();
     2341
    23322342
    23332343    Q_ASSERT(testAttribute(Qt::WA_WState_Created));
  • trunk/src/gui/kernel/qwidget_p.h

    r938 r1034  
    785785    inline HWND frameWinId() const;
    786786    HWND effectiveFrameWinId() const;
     787
    787788    void validateObstacles();
     789
    788790    void reparentChildren();
    789791    void setModalBlocker (QWidget *modal);
  • trunk/src/gui/kernel/qwidget_pm.cpp

    r1019 r1034  
    7575extern MRESULT EXPENTRY QtFrameCtlProc(HWND, ULONG, MPARAM, MPARAM);
    7676
     77
     78
     79
     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
    116122
    117123/*!
     
    231237
    232238/*!
     239
     240
    233241    \enum PWOFlags
    234242    \relates QWidget
     
    249257
    250258/*!
     259
     260
    251261    \fn LONG qt_WinProcessWindowObstacles(HWND hwnd, RECTL *prcl, HRGN hrgn,
    252262                                          LONG op, LONG flags)
     
    511521                               ULONG fl)
    512522{
     523
     524
     525
     526
     527
     528
     529
     530
     531
     532
     533
     534
    513535#if defined(QT_DEBUGWIDGETMASK)
    514536    qDebug() << "qt_WinSetWindowPos: hwnd" << qDebugHWND(hwnd)
     
    843865}
    844866
     867
     868
    845869/*!
    846870    \internal
     
    850874    hrgn. hps is the presentation space of hrgn.
    851875 */
    852 void qt_WinExcludeOverlappingWindows(HWND hwnd, HPS hps, HRGN hrgn)
     876void 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
    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
     1151
     1152
    11251153        }
    11261154
     
    24882516void QWidgetPrivate::setMask_sys(const QRegion &region)
    24892517{
     2518
    24902519    // @todo implement
     2520
    24912521}
    24922522
     
    25672597}
    25682598
     2599
     2600
    25692601/*!
    25702602    \internal
     
    25902622}
    25912623
     2624
     2625
    25922626QT_END_NAMESPACE
  • trunk/src/gui/kernel/qwindowdefs_pm.h

    r1013 r1034  
    9292Q_GUI_EXPORT QWidget *qt_widget_from_hwnd(HWND hwnd);
    9393
     94
     95
    9496enum PWOFlags {
    9597    PWO_Children = 0x01,
     
    109111                                                        LONG flags);
    110112#endif
     113
     114
    111115
    112116// QDebug helpers for debugging various API types
  • trunk/src/gui/painting/qwindowsurface_pm.cpp

    r1033 r1034  
    608608        bmh.cy = d->image->height();
    609609
     610
    610611        int wh = widget->height();
    611612
     
    623624            GpiSetClipRegion(wps, wrgn, &oldRgn);
    624625            wrgn = oldRgn;
    625 
     626#endif
    626627            // Note: target is inclusive-inclusive, source is inclusive-exclusive
    627628            POINTL ptls[] = { { wbr.left(), wbr.top() },
     
    631632            GpiDrawBits(wps, (PVOID) const_cast<const QImage *>(d->image)->bits(),
    632633                        (PBITMAPINFO2) &bmh, 4, ptls, ROP_SRCCOPY, BBO_IGNORE);
     634
     635
    633636        }
    634637
    635638        if (wrgn != NULLHANDLE)
    636639            GpiDestroyRegion(wps, wrgn);
     640
    637641
    638642        widget->releasePS(wps);
     
    696700        HWND hwndWidget = widget->internalWinId();
    697701        ULONG rc = WinQueryVisibleRegion(hwndWidget, hrgn);
     702
    698703        if (rc != RGN_ERROR) {
    699704            // substract children from the visible region, if any
    700705            rc = qt_WinProcessWindowObstacles(hwndWidget, NULL, hrgn,
    701706                                              CRGN_DIFF, PWO_Children);
     707
    702708            if (rc != RGN_ERROR && hwnd != hwndWidget) {
    703709                // translate coords to the main widget's coordinate space
     
    708714                GpiOffsetRegion(hps, hrgn, &ptlOffset);
    709715            }
    710         }
     716#ifdef QT_PM_NATIVEWIDGETMASK
     717        }
     718#endif
    711719
    712720        if (rc == RGN_RECT || rc == RGN_COMPLEX) {
  • trunk/src/gui/painting/qwindowsurface_raster.cpp

    r846 r1034  
    248248    int ih = img.height();
    249249
     250
    250251    // produce a clip region that excludes all descending obstacles
    251252    // (like child widgets with real HWNDs which are not excluded by Qt)
     
    261262        GpiSetClipRegion(wps, wrgn, &oldRgn);
    262263        wrgn = oldRgn;
    263 
     264#endif
    264265        // Note: target is inclusive-inclusive, source is inclusive-exclusive
    265266        POINTL ptls[] = { { wbr.left(), wh - wbr.bottom() - 1 },
     
    275276        GpiDrawBits(wps, (PVOID) img.bits(), (PBITMAPINFO2) &bmh, 4, ptls,
    276277                    ROP_SRCCOPY, BBO_IGNORE);
     278
     279
    277280    }
    278281
    279282    if (wrgn != NULLHANDLE)
    280283        GpiDestroyRegion(wps, wrgn);
     284
    281285
    282286#elif QT_BITMAP_MIRROR == 2
     
    306310    bmh.cy = d->image->height();
    307311
     312
    308313    int wh = widget->height();
    309314
     
    321326        GpiSetClipRegion(wps, wrgn, &oldRgn);
    322327        wrgn = oldRgn;
    323 
     328#endif
    324329        // Note: target is inclusive-inclusive, source is inclusive-exclusive
    325330        POINTL ptls[] = { { wbr.left(), wbr.top() },
     
    343348
    344349        GpiEnableYInversion(wps, oldInversion);
     350
     351
    345352    }
    346353
    347354    if (wrgn != NULLHANDLE)
    348355        GpiDestroyRegion(wps, wrgn);
     356
    349357
    350358#ifndef QT_NO_DEBUG
     
    391399    bmh.cy = d->image->height();
    392400
     401
    393402    int wh = widget->height();
    394403
     
    406415        GpiSetClipRegion(wps, wrgn, &oldRgn);
    407416        wrgn = oldRgn;
    408 
     417#endif
    409418        // Note: target is inclusive-inclusive, source is inclusive-exclusive
    410419        POINTL ptls[] = { { wbr.left(), wbr.top() },
     
    414423        GpiDrawBits(wps, (PVOID) const_cast<const QImage &>(d->image->image).bits(),
    415424                    (PBITMAPINFO2) &bmh, 4, ptls, ROP_SRCCOPY, BBO_IGNORE);
     425
     426
    416427    }
    417428
    418429    if (wrgn != NULLHANDLE)
    419430        GpiDestroyRegion(wps, wrgn);
     431
    420432
    421433#ifndef QT_NO_DEBUG
Note: See TracChangeset for help on using the changeset viewer.