diff --git a/docs/changes.txt b/docs/changes.txt index 8acfbae8a2..f74cf55783 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -32,6 +32,7 @@ wxGTK: - Implemented support for underlined fonts in wxStaticText - wxTopLevelWindow::SetSizeHints size increments now work - wxTopLevelWindow::GetSize() returns the size including the WM decorations +- wxTopLevelWindow::GetClientSize() returns 0x0 when the window is minimized wxMSW: diff --git a/docs/latex/wx/window.tex b/docs/latex/wx/window.tex index 1271cec6e6..6983c824cf 100644 --- a/docs/latex/wx/window.tex +++ b/docs/latex/wx/window.tex @@ -873,6 +873,9 @@ Returns the size of the window `client area' in pixels. The client area is the area which may be drawn on by the programmer, excluding title bar, border, scrollbars, etc. +Note that if this window is a top-level one and it is currently minimized, the +return size is empty (both width and height are $0$). + \wxheading{Parameters} \docparam{width}{Receives the client width in pixels.} diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 3d4a155fc7..062f13429a 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -972,6 +972,18 @@ void wxTopLevelWindowGTK::DoGetSize(int *width, int *height) const void wxTopLevelWindowGTK::DoGetClientSize( int *width, int *height ) const { + if ( IsIconized() ) + { + // for consistency with wxMSW, client area is supposed to be empty for + // the iconized windows + if ( width ) + *width = 0; + if ( height ) + *height = 0; + + return; + } + wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") ); if (height)