]> Pileus Git - ~andy/gtk/commitdiff
Fix #167259, reported by Christian Persch:
authorMatthias Clasen <mclasen@redhat.com>
Thu, 24 Feb 2005 16:37:14 +0000 (16:37 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 24 Feb 2005 16:37:14 +0000 (16:37 +0000)
2005-02-24  Matthias Clasen  <mclasen@redhat.com>

        Fix #167259, reported by  Christian Persch:

* gtk/gtkwidget.c (gtk_widget_unparent): Unmap the reparented
widget, even if we avoid the unrealizing.
(gtk_widget_reparent_subwindows): Make reparenting work for
!NO_WINDOW widgets which have other windows which are siblings
of widget->window (as e.g. GtkSpinButton).

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkwidget.c

index 93d868143b451874d60cb4b8e15a1f6bd778c91d..18b5e577d226a3cb8e24310278777175746da276 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-02-24  Matthias Clasen  <mclasen@redhat.com>
+
+        Fix #167259, reported by  Christian Persch:
+       
+       * gtk/gtkwidget.c (gtk_widget_unparent): Unmap the reparented 
+       widget, even if we avoid the unrealizing. 
+       (gtk_widget_reparent_subwindows): Make reparenting work for
+       !NO_WINDOW widgets which have other windows which are siblings
+       of widget->window (as e.g. GtkSpinButton).
+
 2005-02-24  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_row_changed): 
index 93d868143b451874d60cb4b8e15a1f6bd778c91d..18b5e577d226a3cb8e24310278777175746da276 100644 (file)
@@ -1,3 +1,13 @@
+2005-02-24  Matthias Clasen  <mclasen@redhat.com>
+
+        Fix #167259, reported by  Christian Persch:
+       
+       * gtk/gtkwidget.c (gtk_widget_unparent): Unmap the reparented 
+       widget, even if we avoid the unrealizing. 
+       (gtk_widget_reparent_subwindows): Make reparenting work for
+       !NO_WINDOW widgets which have other windows which are siblings
+       of widget->window (as e.g. GtkSpinButton).
+
 2005-02-24  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_row_changed): 
index 93d868143b451874d60cb4b8e15a1f6bd778c91d..18b5e577d226a3cb8e24310278777175746da276 100644 (file)
@@ -1,3 +1,13 @@
+2005-02-24  Matthias Clasen  <mclasen@redhat.com>
+
+        Fix #167259, reported by  Christian Persch:
+       
+       * gtk/gtkwidget.c (gtk_widget_unparent): Unmap the reparented 
+       widget, even if we avoid the unrealizing. 
+       (gtk_widget_reparent_subwindows): Make reparenting work for
+       !NO_WINDOW widgets which have other windows which are siblings
+       of widget->window (as e.g. GtkSpinButton).
+
 2005-02-24  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreemodelfilter.c (gtk_tree_model_filter_row_changed): 
index 8323e2e843ac340516da710f82f97c95fb15dc09..3a4f76bd85f9cf476c7dfa7edc7d653f7e81bad9 100644 (file)
@@ -1898,8 +1898,13 @@ gtk_widget_unparent (GtkWidget *widget)
   widget->allocation.width = 1;
   widget->allocation.height = 1;
   
-  if (GTK_WIDGET_REALIZED (widget) && !GTK_WIDGET_IN_REPARENT (widget))
-    gtk_widget_unrealize (widget);
+  if (GTK_WIDGET_REALIZED (widget)) 
+    {
+      if (GTK_WIDGET_IN_REPARENT (widget))
+       gtk_widget_unmap (widget);
+      else
+       gtk_widget_unrealize (widget);
+    }
 
   /* Removing a widget from a container restores the child visible
    * flag to the default state, so it doesn't affect the child
@@ -3724,7 +3729,23 @@ gtk_widget_reparent_subwindows (GtkWidget *widget,
       g_list_free (children);
     }
   else
-    gdk_window_reparent (widget->window, new_window, 0, 0);
+   {
+     GdkWindow *parent = gdk_window_get_parent (widget->window);
+
+     GList *children = gdk_window_get_children (parent);
+     GList *tmp_list;
+     for (tmp_list = children; tmp_list; tmp_list = tmp_list->next)
+       {
+        GtkWidget *child;
+        GdkWindow *window = tmp_list->data;
+
+        gdk_window_get_user_data (window, (void **)&child);
+        if (child == widget)
+          gdk_window_reparent (window, new_window, 0, 0);
+       }
+
+      g_list_free (children);
+   }
 }
 
 static void