X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/76fcf0f239c37fbcfe8dcc12f0c59387de96be2a..67e49a98bbba6793cf1e344477bee9e46d4d5c71:/src/gtk/window.cpp diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 8f73c4e2db..1c2d765a7e 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2690,6 +2690,14 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags if (m_resizing) return; /* I don't like recursions */ m_resizing = TRUE; + int currentX, currentY; + GetPosition(¤tX, ¤tY); + if (x == -1) + x = currentX; + if (y == -1) + y = currentY; + AdjustForParentClientOrigin(x, y, sizeFlags); + if (m_parent->m_wxwindow == NULL) /* i.e. wxNotebook */ { /* don't set the size for children of wxNotebook, just take the values. */ @@ -2786,11 +2794,6 @@ void wxWindowGTK::OnInternalIdle() g_sendActivateEvent = -1; wxTheApp->SetActive(activate, (wxWindow *)g_focusWindowLast); - - wxActivateEvent event(wxEVT_ACTIVATE_APP, activate, GetId()); - event.SetEventObject(this); - - (void)GetEventHandler()->ProcessEvent(event); } wxCursor cursor = m_cursor; @@ -2985,9 +2988,21 @@ void wxWindowGTK::DoGetPosition( int *x, int *y ) const dx = pizza->xoffset; dy = pizza->yoffset; } + + int nx = m_x - dx; + int ny = m_y - dy; + + if ( !IsTopLevel() && m_parent ) + { + // We may be faking the client origin. So a window that's really at (0, + // 30) may appear (to wxWin apps) to be at (0, 0). + wxPoint pt(m_parent->GetClientAreaOrigin()); + nx -= pt.x; + ny -= pt.y; + } - if (x) (*x) = m_x - dx; - if (y) (*y) = m_y - dy; + if (x) (*x) = nx; + if (y) (*y) = ny; } void wxWindowGTK::DoClientToScreen( int *x, int *y ) const