+ // calculate a client-origin version of the update rgn and set
+ // m_updateRegion to that
+ clientUpdateRgn.Offset(-clientRect.GetPosition());
+ m_updateRegion = clientUpdateRgn ;
+
+ if ( !m_updateRegion.Empty() )
+ {
+ // paint the window itself
+
+ wxPaintEvent event(GetId());
+ event.SetTimestamp(time);
+ event.SetEventObject(this);
+ handled = HandleWindowEvent(event);
+ }
+
+ m_updateRegion = formerUpdateRgn;
+ return handled;
+}
+
+void wxWindowMac::MacPaintChildrenBorders()
+{
+ // now we cannot rely on having its borders drawn by a window itself, as it does not
+ // get the updateRgn wide enough to always do so, so we do it from the parent
+ // this would also be the place to draw any custom backgrounds for native controls
+ // in Composited windowing
+ wxPoint clientOrigin = GetClientAreaOrigin() ;
+
+ wxWindowMac *child;
+ int x, y, w, h;
+ for (wxWindowList::compatibility_iterator node = GetChildren().GetFirst(); node; node = node->GetNext())
+ {
+ child = node->GetData();
+ if (child == NULL)
+ continue;
+#if wxUSE_SCROLLBAR
+ if (child == m_vScrollBar)
+ continue;
+ if (child == m_hScrollBar)
+ continue;
+ if (child == m_growBox)
+ continue;
+#endif
+ if (child->IsTopLevel())
+ continue;
+ if (!child->IsShown())
+ continue;
+
+ // only draw those in the update region (add a safety margin of 10 pixels for shadow effects