]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/mdi.cpp
add support for alpha in color dialog on OSX, see #14127
[wxWidgets.git] / src / gtk / mdi.cpp
index 760a4ac4ef5c81bde5ca78cedc6f8e1e20ea9799..5480673b29e0d7c815ac4b3eae161bea03674af6 100644 (file)
@@ -191,7 +191,7 @@ void wxMDIParentFrame::DoGetClientSize(int* width, int* height) const
 {
     wxFrame::DoGetClientSize(width, height);
 
-    if (height)
+    if (!m_useCachedClientSize && height)
     {
         wxMDIChildFrame* active_child_frame = GetActiveChild();
         if (active_child_frame)
@@ -200,7 +200,7 @@ void wxMDIParentFrame::DoGetClientSize(int* width, int* height) const
             if (menubar && menubar->IsShown())
             {
                 GtkRequisition req;
-                gtk_widget_size_request(menubar->m_widget, &req);
+                gtk_widget_get_preferred_height(menubar->m_widget, NULL, &req.height);
                 *height -= req.height;
                 if (*height < 0) *height = 0;
             }
@@ -294,6 +294,12 @@ wxMDIChildFrame::~wxMDIChildFrame()
         gtk_widget_queue_draw(m_parent->m_widget);
 }
 
+void wxMDIChildFrame::GTKHandleRealized()
+{
+    // since m_widget is not a GtkWindow, must bypass wxTopLevelWindowGTK
+    wxTopLevelWindowBase::GTKHandleRealized();
+}
+
 void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
 {
     wxASSERT_MSG( m_menuBar == NULL, "Only one menubar allowed" );
@@ -310,14 +316,6 @@ void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
         m_menuBar->Show(false);
         gtk_box_pack_start(GTK_BOX(mdi_frame->m_mainWidget), m_menuBar->m_widget, false, false, 0);
         gtk_box_reorder_child(GTK_BOX(mdi_frame->m_mainWidget), m_menuBar->m_widget, 0);
-
-        gulong handler_id = g_signal_handler_find(
-            m_menuBar->m_widget,
-            GSignalMatchType(G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_DATA),
-            g_signal_lookup("size_request", GTK_TYPE_WIDGET),
-            0, NULL, NULL, m_menuBar);
-        if (handler_id != 0)
-            g_signal_handler_disconnect(m_menuBar->m_widget, handler_id);
         gtk_widget_set_size_request(m_menuBar->m_widget, -1, -1);
     }
 }