Ignore:
Timestamp:
Jun 22, 2010, 9:20:42 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: OS/2: Applied the solution from r751 to the non-DIVE code path (closes #161).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/painting/qwindowsurface_pm.cpp

    r753 r758  
    607607        bmh.cy = d->image->height();
    608608
    609         // Note: target is inclusive-inclusive, source is inclusive-exclusive
    610         POINTL ptls[] = { { wbr.left(), wbr.top() },
    611                           { wbr.right(), wbr.bottom() },
    612                           { br.left(), br.top() },
    613                           { br.right() + 1, br.bottom() + 1 } };
    614         GpiDrawBits(wps, (PVOID) const_cast<const QImage *>(d->image)->bits(),
    615                     (PBITMAPINFO2) &bmh, 4, ptls, ROP_SRCCOPY, BBO_IGNORE);
     609        int wh = widget->height();
     610
     611        // produce a clip region that excludes all descending obstacles
     612        // (like child widgets with real HWNDs which are not excluded by Qt)
     613        HWND wwnd = widget->winId();
     614        RECTL wrcl = { wbr.left(), wh - wbr.bottom() - 1,
     615                       wbr.right() + 1, wh - wbr.top() };
     616        HRGN wrgn = GpiCreateRegion(wps, 1L, &wrcl);
     617        ULONG rc = qt_WinProcessWindowObstacles(wwnd, NULL, wrgn, CRGN_DIFF,
     618                                                PWO_Children);
     619        if (rc == RGN_RECT || rc == RGN_COMPLEX) {
     620            // set the clip region
     621            HRGN oldRgn;
     622            GpiSetClipRegion(wps, wrgn, &oldRgn);
     623            wrgn = oldRgn;
     624
     625            // Note: target is inclusive-inclusive, source is inclusive-exclusive
     626            POINTL ptls[] = { { wbr.left(), wbr.top() },
     627                              { wbr.right(), wbr.bottom() },
     628                              { br.left(), br.top() },
     629                              { br.right() + 1, br.bottom() + 1 } };
     630            GpiDrawBits(wps, (PVOID) const_cast<const QImage *>(d->image)->bits(),
     631                        (PBITMAPINFO2) &bmh, 4, ptls, ROP_SRCCOPY, BBO_IGNORE);
     632        }
     633
     634        if (wrgn != NULLHANDLE)
     635            GpiDestroyRegion(wps, wrgn);
    616636
    617637        widget->releasePS(wps);
Note: See TracChangeset for help on using the changeset viewer.