]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/toplevel.cpp
Fix install_name_tool calls in OS X "make install".
[wxWidgets.git] / src / gtk / toplevel.cpp
index 3c7d3038e4d19e99e102a1b0acf4db3cc98cba5b..66da4cb24698c8c18a2d7f6c7b93d1e8397ad899 100644 (file)
@@ -327,11 +327,14 @@ void wxTopLevelWindowGTK::GTKConfigureEvent(int x, int y)
         gtk_window_get_position(GTK_WINDOW(m_widget), &point.x, &point.y);
     }
 
-    m_x = point.x;
-    m_y = point.y;
-    wxMoveEvent event(point, GetId());
-    event.SetEventObject(this);
-    HandleWindowEvent(event);
+    if (m_x != point.x || m_y != point.y)
+    {
+        m_x = point.x;
+        m_y = point.y;
+        wxMoveEvent event(point, GetId());
+        event.SetEventObject(this);
+        HandleWindowEvent(event);
+    }
 }
 
 //-----------------------------------------------------------------------------
@@ -350,14 +353,6 @@ void wxTopLevelWindowGTK::GTKHandleRealized()
     gdk_window_set_functions(gtk_widget_get_window(m_widget),
                                (GdkWMFunction)m_gdkFunc);
 
-    // GTK's shrinking/growing policy
-    if ( !(m_gdkFunc & GDK_FUNC_RESIZE) )
-        gtk_window_set_resizable(GTK_WINDOW(m_widget), FALSE);
-#ifndef __WXGTK3__
-    else
-        gtk_window_set_policy(GTK_WINDOW(m_widget), 1, 1, 1);
-#endif
-
     const wxIconBundle& icons = GetIcons();
     if (icons.GetIconCount())
         SetIcons(icons);
@@ -554,11 +549,9 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
                                   long style,
                                   const wxString &name )
 {
-    // always create a frame of some reasonable, even if arbitrary, size (at
-    // least for MSW compatibility)
-    wxSize size = sizeOrig;
-    size.x = WidthDefault(size.x);
-    size.y = HeightDefault(size.y);
+    wxSize size(sizeOrig);
+    if (!size.IsFullySpecified())
+        size.SetDefaults(GetDefaultSize());
 
     wxTopLevelWindows.Append( this );
 
@@ -669,7 +662,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
     PostCreation();
 
 #ifndef __WXGTK3__
-    if ((m_x != -1) || (m_y != -1))
+    if (pos != wxDefaultPosition)
         gtk_widget_set_uposition( m_widget, m_x, m_y );
 #endif
 
@@ -751,8 +744,12 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
         }
     }
 
-    // GTK sometimes chooses very small size if max size hint is not explicitly set
-    DoSetSizeHints(m_minWidth, m_minHeight, m_maxWidth, m_maxHeight, m_incWidth, m_incHeight);
+    if ((style & wxRESIZE_BORDER) == 0)
+        gtk_window_set_resizable(GTK_WINDOW(m_widget), false);
+#ifndef __WXGTK3__
+    else
+        gtk_window_set_policy(GTK_WINDOW(m_widget), 1, 1, 1);
+#endif
 
     m_decorSize = GetCachedDecorSize();
     int w, h;
@@ -1102,6 +1099,9 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si
     if ( m_x != old_x || m_y != old_y )
     {
         gtk_window_move( GTK_WINDOW(m_widget), m_x, m_y );
+        wxMoveEvent event(wxPoint(m_x, m_y), GetId());
+        event.SetEventObject(this);
+        HandleWindowEvent(event);
     }
 
     const wxSize oldSize(m_width, m_height);