Ignore:
Timestamp:
Aug 28, 2011, 2:00:00 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

OS/2: Fix native child widget painting in DIVE mode.

The dirty regions of nested child widgets were calculated incorrectly since the
HWND of the top-level window was used instead of the child HWND.

Note that this didn't show problems in Qt 4.6.3 since requesting a native HWND
for a child (which is used by video players to embed video to the Qt
application) didn't cause its siblings and sibligs of its parents to get native
HWNDs and therefore they didn't use the code that contained this bug. But in
r1012 this incorrect behavior was fixed and the problem immediately popped up.

File:
1 edited

Legend:

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

    r808 r1033  
    524524
    525525    setStaticContentsSupport(true);
     526
     527    DEBUG(() << "QPMDiveWindowSurface:" << widget);
    526528}
    527529
     
    658660bool QPMDiveWindowSurface::adjustSetup(QWidget *widget)
    659661{
     662    DEBUG(() << "QPMDiveWindowSurface::adjustSetup:" << window() << widget);
     663
    660664    HWND hwnd = window()->internalWinId();
    661665
     
    687691        wd->vrnDirty = false;
    688692
    689         HPS hps = window()->getPS();
     693        HPS hps = widget->getPS();
    690694        HRGN hrgn = GpiCreateRegion(hps, 0L, NULL);
    691695
    692         ULONG rc = WinQueryVisibleRegion(hwnd, hrgn);
     696        HWND hwndWidget = widget->internalWinId();
     697        ULONG rc = WinQueryVisibleRegion(hwndWidget, hrgn);
    693698        if (rc != RGN_ERROR) {
    694             HWND hwndWidget = widget->internalWinId();
    695             POINTL ptlOffset = { 0, 0 };
    696             if (hwnd != hwndWidget) {
    697                 // translate the main widget's visible region to this widget's
    698                 // coordinate space
    699                 WinMapWindowPoints(hwnd, hwndWidget, &ptlOffset, 1);
    700                 GpiOffsetRegion(hps, hrgn, &ptlOffset);
    701             }
    702699            // substract children from the visible region, if any
    703700            rc = qt_WinProcessWindowObstacles(hwndWidget, NULL, hrgn,
    704701                                              CRGN_DIFF, PWO_Children);
    705702            if (rc != RGN_ERROR && hwnd != hwndWidget) {
    706                 // translate back to the main widget's coordinate space
     703                // translate coords to the main widget's coordinate space
     704                POINTL ptlOffset = { 0, 0 };
     705                WinMapWindowPoints(hwnd, hwndWidget, &ptlOffset, 1);
    707706                ptlOffset.x = -ptlOffset.x;
    708707                ptlOffset.y = -ptlOffset.y;
     
    731730
    732731        GpiDestroyRegion(hps, hrgn);
    733         window()->releasePS(hps);
     732        widget->releasePS(hps);
    734733
    735734        // memorize the window height used for the additional visible region
Note: See TracChangeset for help on using the changeset viewer.