| @@ -1402,23 +1402,26 @@ private: | |||||
| { | { | ||||
| HWNDComponentPeer* peer; | HWNDComponentPeer* peer; | ||||
| RectangleList<int>* clip; | RectangleList<int>* clip; | ||||
| Point<int> origin; | |||||
| }; | }; | ||||
| static BOOL CALLBACK clipChildWindowCallback (HWND hwnd, LPARAM context) | static BOOL CALLBACK clipChildWindowCallback (HWND hwnd, LPARAM context) | ||||
| { | { | ||||
| if (IsWindowVisible (hwnd)) | if (IsWindowVisible (hwnd)) | ||||
| { | { | ||||
| const EnumWindowsInfo& info = *(EnumWindowsInfo*) context; | |||||
| HWND parent = GetParent (hwnd); | HWND parent = GetParent (hwnd); | ||||
| if (parent == ((EnumWindowsInfo*) context)->peer->hwnd) | |||||
| if (parent == info.peer->hwnd) | |||||
| { | { | ||||
| RECT r = getWindowRect (hwnd); | RECT r = getWindowRect (hwnd); | ||||
| POINT pos = { r.left, r.top }; | POINT pos = { r.left, r.top }; | ||||
| ScreenToClient (GetParent (hwnd), &pos); | ScreenToClient (GetParent (hwnd), &pos); | ||||
| ((EnumWindowsInfo*) context)->clip->subtract (Rectangle<int> (pos.x, pos.y, | |||||
| r.right - r.left, | |||||
| r.bottom - r.top)); | |||||
| info.clip->subtract (Rectangle<int> (pos.x, pos.y, | |||||
| r.right - r.left, | |||||
| r.bottom - r.top) - info.origin); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1547,8 +1550,10 @@ private: | |||||
| contextClip.addWithoutMerging (Rectangle<int> (w, h)); | contextClip.addWithoutMerging (Rectangle<int> (w, h)); | ||||
| } | } | ||||
| EnumWindowsInfo enumInfo = { this, &contextClip }; | |||||
| EnumChildWindows (hwnd, clipChildWindowCallback, (LPARAM) &enumInfo); | |||||
| { | |||||
| EnumWindowsInfo enumInfo = { this, &contextClip, Point<int> (x, y) }; | |||||
| EnumChildWindows (hwnd, clipChildWindowCallback, (LPARAM) &enumInfo); | |||||
| } | |||||
| if (! contextClip.isEmpty()) | if (! contextClip.isEmpty()) | ||||
| { | { | ||||