]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/minifram.cpp
Fix for the irksome, 'Details' sizing bug. Or at least a patch on a hornet's
[wxWidgets.git] / src / gtk / minifram.cpp
index 8e823f312b67a635080fe5126066797c3fcd6e35..6f0c63d0d3603cd27037624c481b76034dc785e9 100644 (file)
@@ -164,6 +164,13 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
 
     if (win->m_isDragging) return TRUE;
 
+    GtkPizza *pizza = GTK_PIZZA(widget);
+    if (gdk_event->window != pizza->bin_window) return TRUE;
+    
+    GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0);
+    int height = font->ascent + font->descent+1;
+    if (gdk_event->y > height) return TRUE;
+        
     gdk_window_raise( win->m_widget->window );
 
     gdk_pointer_grab( widget->window, FALSE,
@@ -270,7 +277,7 @@ static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxMiniFram
 // wxMiniFrame
 //-----------------------------------------------------------------------------
 
-static char *cross_xpm[] = {
+static const char *cross_xpm[] = {
 /* columns rows colors chars-per-pixel */
 "5 5 16 1",
 "  c Gray0",
@@ -303,7 +310,7 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
       const wxPoint &pos, const wxSize &size,
       long style, const wxString &name )
 {
-    style = style | wxCAPTION | wxFRAME_FLOAT_ON_PARENT;
+    style = style | wxCAPTION;
 
     if ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT))
         m_miniTitle = 13;
@@ -317,11 +324,22 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
 
     wxFrame::Create( parent, id, title, pos, size, style, name );
 
+    if (m_parent && (GTK_IS_WINDOW(m_parent->m_widget)))
+    {
+        gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) );
+    }
+    
     if ((style & wxSYSTEM_MENU) &&
         ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT)))
     {
         GdkBitmap *mask = (GdkBitmap*) NULL;
-        GdkPixmap *pixmap = gdk_pixmap_create_from_xpm_d( wxGetRootWindow()->window, &mask, NULL, cross_xpm );
+        GdkPixmap *pixmap = gdk_pixmap_create_from_xpm_d
+                            (
+                                wxGetRootWindow()->window,
+                                &mask,
+                                NULL,
+                                (char **)cross_xpm
+                            );
 
         GtkWidget *pw = gtk_pixmap_new( pixmap, mask );
         gdk_bitmap_unref( mask );