X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ee1787872dfad4da69b3cc986ee603a345f089ed..4a699e3a59b19c21b6faae714b56cac5a75df2e2:/src/gtk/toplevel.cpp diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index b55b5663a8..0dd59d4b33 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -246,22 +246,6 @@ size_allocate(GtkWidget*, GtkAllocation* alloc, wxTopLevelWindowGTK* win) } } -// ---------------------------------------------------------------------------- -// "size_request" -// ---------------------------------------------------------------------------- - -extern "C" { -static -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 - win->GTKDoGetSize(&requisition->width, &requisition->height); -} -} - //----------------------------------------------------------------------------- // "delete_event" //----------------------------------------------------------------------------- @@ -628,8 +612,6 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, g_signal_connect(m_wxwindow, "size_allocate", G_CALLBACK(size_allocate), this); - g_signal_connect (m_widget, "size_request", - G_CALLBACK (wxgtk_tlw_size_request_callback), this); PostCreation(); #if !GTK_CHECK_VERSION(3,0,0) && !defined(GTK_DISABLE_DEPRECATED) @@ -703,6 +685,15 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, } } + // GTK sometimes chooses very small size if max size hint is not explicitly set + int maxWidth = m_maxWidth; + int maxHeight = m_maxHeight; + if (maxWidth < 0) + maxWidth = INT_MAX; + if (maxHeight < 0) + maxHeight = INT_MAX; + DoSetSizeHints(m_minWidth, m_minHeight, maxWidth, maxHeight, -1, -1); + m_decorSize = GetCachedDecorSize(); int w, h; GTKDoGetSize(&w, &h); @@ -1442,7 +1433,7 @@ bool wxTopLevelWindowGTK::CanSetTransparent() #if GTK_CHECK_VERSION(2,10,0) if (!gtk_check_version(2,10,0)) { - return (gtk_widget_is_composited (m_widget)); + return gtk_widget_is_composited(m_widget) != 0; } else #endif // In case of lower versions than gtk+-2.10.0 we could look for _NET_WM_CM_Sn ourselves