]> git.saurik.com Git - wxWidgets.git/commitdiff
Funny resize behaviour fix.
authorRobert Roebling <robert@roebling.de>
Sun, 19 Mar 2000 16:23:09 +0000 (16:23 +0000)
committerRobert Roebling <robert@roebling.de>
Sun, 19 Mar 2000 16:23:09 +0000 (16:23 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6860 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/app.cpp
src/gtk/dialog.cpp
src/gtk/frame.cpp
src/gtk1/app.cpp
src/gtk1/dialog.cpp
src/gtk1/frame.cpp

index 84f625014f42d0170e1442b7667cb0f4fa3fb280..6369b7d3a77134be85d99e4e2c30992d62342f34 100644 (file)
@@ -250,7 +250,7 @@ wxApp::wxApp()
     m_topWindow = (wxWindow *) NULL;
     m_exitOnFrameDelete = TRUE;
 
-    m_idleTag = gtk_idle_add( wxapp_idle_callback, (gpointer) NULL );
+    m_idleTag = gtk_idle_add_priority( 500, wxapp_idle_callback, (gpointer) NULL );
 
 #if wxUSE_THREADS
     m_wakeUpTimerTag = 0;
index 55d5e955114854e6c749e4eba331c7dbd45a7faa..7550d74cefbf2a3fbeed8aed5d71c0dc3847c19c 100644 (file)
@@ -131,11 +131,6 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win )
     if (g_isIdle)
         wxapp_install_idle_handler();
 
-    /* I haven't been able to set the position of
-       the dialog before it is shown, so I set the
-       position in "realize" */
-    gtk_widget_set_uposition( widget, win->m_x, win->m_y );
-
     /* all this is for Motif Window Manager "hints" and is supposed to be
        recognized by other WM as well. not tested. */
     long decor = (long) GDK_DECOR_BORDER;
@@ -308,6 +303,10 @@ bool wxDialog::Create( wxWindow *parent,
 
     PostCreation();
 
+    if ((m_x != -1) || (m_y != -1))
+        gtk_widget_set_uposition( m_widget, m_x, m_y );
+    gtk_widget_set_usize( m_widget, m_width, m_height );
+        
     /*  we cannot set MWM hints  before the widget has
         been realized, so we do this directly after realization */
     gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
@@ -530,6 +529,8 @@ void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags )
 
     if ((m_width != old_width) || (m_height != old_height))
     {
+        gtk_widget_set_usize( m_widget, m_width, m_height );
+
         /* actual resizing is deferred to GtkOnSize in idle time and
            when showing the dialog */
         m_sizeSet = FALSE;
@@ -555,9 +556,6 @@ void wxDialog::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int heigh
     if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
     if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
 
-    /* we actually set the size of a frame here and no-where else */
-    gtk_widget_set_usize( m_widget, m_width, m_height );
-
     m_sizeSet = TRUE;
 
     wxSizeEvent event( wxSize(m_width,m_height), GetId() );
index 6f7ffa47a8ea1ef453f74a34a874e22b9c876185..04d24079999c66e73fa11dd6e424f4aebc2e60b1 100644 (file)
@@ -248,11 +248,6 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
     if (g_isIdle)
         wxapp_install_idle_handler();
 
-    /* I haven't been able to set the position of
-       the dialog before it is shown, so I set the
-       position in "realize" */
-    gtk_widget_set_uposition( widget, win->m_x, win->m_y );
-
     if ((win->m_miniEdge > 0) || (win->HasFlag(wxSIMPLE_BORDER)))
     {
         /* This is a mini-frame or a borderless frame. */
@@ -490,6 +485,10 @@ bool wxFrame::Create( wxWindow *parent,
 
     PostCreation();
 
+    if ((m_x != -1) || (m_y != -1))
+        gtk_widget_set_uposition( m_widget, m_x, m_y );
+    gtk_widget_set_usize( m_widget, m_width, m_height );
+        
     /*  we cannot set MWM hints and icons before the widget has
         been realized, so we do this directly after realization */
     gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
@@ -610,6 +609,8 @@ void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags )
 
     if ((m_width != old_width) || (m_height != old_height))
     {
+        gtk_widget_set_usize( m_widget, m_width, m_height );
+
         /* we set the size in GtkOnSize, i.e. mostly the actual resizing is
            done either directly before the frame is shown or in idle time
            so that different calls to SetSize() don't lead to flicker. */
@@ -852,7 +853,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
 #endif
 
     /* we actually set the size of a frame here and no-where else */
-    gtk_widget_set_usize( m_widget, m_width, m_height );
+//    gtk_widget_set_usize( m_widget, m_width, m_height );
 
     m_sizeSet = TRUE;
 
index 84f625014f42d0170e1442b7667cb0f4fa3fb280..6369b7d3a77134be85d99e4e2c30992d62342f34 100644 (file)
@@ -250,7 +250,7 @@ wxApp::wxApp()
     m_topWindow = (wxWindow *) NULL;
     m_exitOnFrameDelete = TRUE;
 
-    m_idleTag = gtk_idle_add( wxapp_idle_callback, (gpointer) NULL );
+    m_idleTag = gtk_idle_add_priority( 500, wxapp_idle_callback, (gpointer) NULL );
 
 #if wxUSE_THREADS
     m_wakeUpTimerTag = 0;
index 55d5e955114854e6c749e4eba331c7dbd45a7faa..7550d74cefbf2a3fbeed8aed5d71c0dc3847c19c 100644 (file)
@@ -131,11 +131,6 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win )
     if (g_isIdle)
         wxapp_install_idle_handler();
 
-    /* I haven't been able to set the position of
-       the dialog before it is shown, so I set the
-       position in "realize" */
-    gtk_widget_set_uposition( widget, win->m_x, win->m_y );
-
     /* all this is for Motif Window Manager "hints" and is supposed to be
        recognized by other WM as well. not tested. */
     long decor = (long) GDK_DECOR_BORDER;
@@ -308,6 +303,10 @@ bool wxDialog::Create( wxWindow *parent,
 
     PostCreation();
 
+    if ((m_x != -1) || (m_y != -1))
+        gtk_widget_set_uposition( m_widget, m_x, m_y );
+    gtk_widget_set_usize( m_widget, m_width, m_height );
+        
     /*  we cannot set MWM hints  before the widget has
         been realized, so we do this directly after realization */
     gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
@@ -530,6 +529,8 @@ void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags )
 
     if ((m_width != old_width) || (m_height != old_height))
     {
+        gtk_widget_set_usize( m_widget, m_width, m_height );
+
         /* actual resizing is deferred to GtkOnSize in idle time and
            when showing the dialog */
         m_sizeSet = FALSE;
@@ -555,9 +556,6 @@ void wxDialog::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int heigh
     if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
     if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
 
-    /* we actually set the size of a frame here and no-where else */
-    gtk_widget_set_usize( m_widget, m_width, m_height );
-
     m_sizeSet = TRUE;
 
     wxSizeEvent event( wxSize(m_width,m_height), GetId() );
index 6f7ffa47a8ea1ef453f74a34a874e22b9c876185..04d24079999c66e73fa11dd6e424f4aebc2e60b1 100644 (file)
@@ -248,11 +248,6 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
     if (g_isIdle)
         wxapp_install_idle_handler();
 
-    /* I haven't been able to set the position of
-       the dialog before it is shown, so I set the
-       position in "realize" */
-    gtk_widget_set_uposition( widget, win->m_x, win->m_y );
-
     if ((win->m_miniEdge > 0) || (win->HasFlag(wxSIMPLE_BORDER)))
     {
         /* This is a mini-frame or a borderless frame. */
@@ -490,6 +485,10 @@ bool wxFrame::Create( wxWindow *parent,
 
     PostCreation();
 
+    if ((m_x != -1) || (m_y != -1))
+        gtk_widget_set_uposition( m_widget, m_x, m_y );
+    gtk_widget_set_usize( m_widget, m_width, m_height );
+        
     /*  we cannot set MWM hints and icons before the widget has
         been realized, so we do this directly after realization */
     gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
@@ -610,6 +609,8 @@ void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags )
 
     if ((m_width != old_width) || (m_height != old_height))
     {
+        gtk_widget_set_usize( m_widget, m_width, m_height );
+
         /* we set the size in GtkOnSize, i.e. mostly the actual resizing is
            done either directly before the frame is shown or in idle time
            so that different calls to SetSize() don't lead to flicker. */
@@ -852,7 +853,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
 #endif
 
     /* we actually set the size of a frame here and no-where else */
-    gtk_widget_set_usize( m_widget, m_width, m_height );
+//    gtk_widget_set_usize( m_widget, m_width, m_height );
 
     m_sizeSet = TRUE;