[gtk+/gtk-3-10] GtkWindow: Override gtk_container_remove ()



commit 2f86f03a58da180eca2d9cce01b5b56da039c491
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Thu Oct 3 19:07:37 2013 +0200

    GtkWindow: Override gtk_container_remove ()
    
    Check which child is being removed, title_box or the GtkBin child.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709049

 gtk/gtkwindow.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index e10500d..dd34f75 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -389,6 +389,8 @@ static gint gtk_window_focus_out_event    (GtkWidget         *widget,
 static void gtk_window_style_updated      (GtkWidget         *widget);
 static gboolean gtk_window_state_event    (GtkWidget          *widget,
                                            GdkEventWindowState *event);
+static void gtk_window_remove             (GtkContainer      *container,
+                                           GtkWidget         *widget);
 static void gtk_window_check_resize       (GtkContainer      *container);
 static void gtk_window_forall             (GtkContainer   *container,
                                           gboolean     include_internals,
@@ -666,6 +668,7 @@ gtk_window_class_init (GtkWindowClass *klass)
   widget_class->get_preferred_height = gtk_window_get_preferred_height;
   widget_class->get_preferred_height_for_width = gtk_window_get_preferred_height_for_width;
 
+  container_class->remove = gtk_window_remove;
   container_class->check_resize = gtk_window_check_resize;
   container_class->forall = gtk_window_forall;
 
@@ -7572,6 +7575,17 @@ gtk_window_focus_out_event (GtkWidget     *widget,
 }
 
 static void
+gtk_window_remove (GtkContainer *container,
+                  GtkWidget     *widget)
+{
+  GtkWindow *window = GTK_WINDOW (container);
+  if (widget == window->priv->title_box)
+    unset_titlebar (window);
+  else
+    GTK_CONTAINER_CLASS (gtk_window_parent_class)->remove (container, widget);
+}
+
+static void
 gtk_window_check_resize (GtkContainer *container)
 {
   /* If the window is not toplevel anymore than it's embedded somewhere,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]