[gtk+] Maintain map/unmap invariants in GtkRecentChooserDialog



commit e8bb2e4545365d83261381a14920b773aba4a678
Author: Kjell Ahlstedt <kjell ahlstedt bredband net>
Date:   Wed Nov 16 09:03:12 2011 +0100

    Maintain map/unmap invariants in GtkRecentChooserDialog
    
    We used to explicitly map and unmap the child GtkRecentChooserWidget when
    mapping and unmapping the dialog, respectively. Now that GtkContainer actually
    unmaps child widgets (instead of avoiding that), we can assume that the
    child GtkRecentChooserWidget will be unmapped when we want it to be.
    
    This fixes a warning from gtk_widget_verify_invariants(), as we were mapping
    our child widget before calling our parent class' ::map() handler. Bug #659257.

 gtk/gtkrecentchooserdialog.c |   30 ------------------------------
 1 files changed, 0 insertions(+), 30 deletions(-)
---
diff --git a/gtk/gtkrecentchooserdialog.c b/gtk/gtkrecentchooserdialog.c
index 7a1a925..5ee55e2 100644
--- a/gtk/gtkrecentchooserdialog.c
+++ b/gtk/gtkrecentchooserdialog.c
@@ -100,9 +100,6 @@ static void gtk_recent_chooser_dialog_get_property (GObject      *object,
 						    GValue       *value,
 						    GParamSpec   *pspec);
 
-static void gtk_recent_chooser_dialog_map       (GtkWidget *widget);
-static void gtk_recent_chooser_dialog_unmap     (GtkWidget *widget);
-
 G_DEFINE_TYPE_WITH_CODE (GtkRecentChooserDialog,
 			 gtk_recent_chooser_dialog,
 			 GTK_TYPE_DIALOG,
@@ -113,16 +110,12 @@ static void
 gtk_recent_chooser_dialog_class_init (GtkRecentChooserDialogClass *klass)
 {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-  GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
   
   gobject_class->set_property = gtk_recent_chooser_dialog_set_property;
   gobject_class->get_property = gtk_recent_chooser_dialog_get_property;
   gobject_class->constructor = gtk_recent_chooser_dialog_constructor;
   gobject_class->finalize = gtk_recent_chooser_dialog_finalize;
   
-  widget_class->map = gtk_recent_chooser_dialog_map;
-  widget_class->unmap = gtk_recent_chooser_dialog_unmap;
-  
   _gtk_recent_chooser_install_properties (gobject_class);
   
   g_type_class_add_private (klass, sizeof (GtkRecentChooserDialogPrivate));
@@ -280,29 +273,6 @@ gtk_recent_chooser_dialog_finalize (GObject *object)
   G_OBJECT_CLASS (gtk_recent_chooser_dialog_parent_class)->finalize (object);
 }
 
-static void
-gtk_recent_chooser_dialog_map (GtkWidget *widget)
-{
-  GtkRecentChooserDialog *dialog = GTK_RECENT_CHOOSER_DIALOG (widget);
-  GtkRecentChooserDialogPrivate *priv = dialog->priv;
-  
-  if (!gtk_widget_get_mapped (priv->chooser))
-    gtk_widget_map (priv->chooser);
-
-  GTK_WIDGET_CLASS (gtk_recent_chooser_dialog_parent_class)->map (widget);
-}
-
-static void
-gtk_recent_chooser_dialog_unmap (GtkWidget *widget)
-{
-  GtkRecentChooserDialog *dialog = GTK_RECENT_CHOOSER_DIALOG (widget);
-  GtkRecentChooserDialogPrivate *priv = dialog->priv;
-  
-  GTK_WIDGET_CLASS (gtk_recent_chooser_dialog_parent_class)->unmap (widget);
-  
-  gtk_widget_unmap (priv->chooser);
-}
-
 static GtkWidget *
 gtk_recent_chooser_dialog_new_valist (const gchar      *title,
 				      GtkWindow        *parent,



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