}
}
+// ----------------------------------------------------------------------------
+// "size_request"
+// ----------------------------------------------------------------------------
+
+extern "C" {
+void wxgtk_tlw_size_request_callback(GtkWidget * WXUNUSED(widget),
+ GtkRequisition *requisition,
+ wxTopLevelWindowGTK *win)
+{
+ // we must return the size of the window without WM decorations, otherwise
+ // GTK+ gets confused, so don't call just GetSize() here
+ int w, h;
+ win->GTKDoGetSize(&w, &h);
+
+ requisition->height = h;
+ requisition->width = w;
+}
+}
//-----------------------------------------------------------------------------
// "delete_event"
//-----------------------------------------------------------------------------
g_signal_connect (m_widget, "size_allocate",
G_CALLBACK (gtk_frame_size_callback), this);
+ g_signal_connect (m_widget, "size_request",
+ G_CALLBACK (wxgtk_tlw_size_request_callback), this);
PostCreation();
if ((m_x != -1) || (m_y != -1))
// window geometry
// ----------------------------------------------------------------------------
+void wxTopLevelWindowGTK::GTKDoGetSize(int *width, int *height) const
+{
+ return wxTopLevelWindowBase::DoGetSize(width, height);
+}
+
void wxTopLevelWindowGTK::GTKDoSetSize(int width, int height)
{
// avoid recursions
int wUndec,
hUndec;
- wxTopLevelWindowBase::DoGetSize(&wUndec, &hUndec);
+ GTKDoGetSize(&wUndec, &hUndec);
if ( width != -1 )
width -= wTotal - wUndec;
{
// this can happen if we're called before the window is realized, so
// don't assert but just return the stored values
- wxTopLevelWindowBase::DoGetSize(width, height);
+ GTKDoGetSize(width, height);
return;
}
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)