[gtk+] bgo#640161 - Maintain map/unmap invariants in GtkFileChooserDialog



commit 84bf984f8501201e082b888bc5479b5b8770c02b
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Jan 21 15:39:17 2011 -0600

    bgo#640161 - Maintain map/unmap invariants in GtkFileChooserDialog
    
    We used to explicitly map and unmap the child GtkFileChooserWidget when
    mapping and unmapping the dialog, respectively.  Now that GtkWidget actually
    unmaps child widgets (instead of avoiding that), we can assume that the
    child GtkFileChooserWidget will be unmapped when we wanted it to be.
    
    This fixes a warning that happened with the new GtkWidget invariant checker,
    as we were mapping our child widget before calling our parent class' ::map() handler.
    
    Signed-off-by: Federico Mena Quintero <federico gnome org>

 gtk/gtkfilechooserdialog.c |   23 -----------------------
 1 files changed, 0 insertions(+), 23 deletions(-)
---
diff --git a/gtk/gtkfilechooserdialog.c b/gtk/gtkfilechooserdialog.c
index dd8a9a8..cf0dd75 100644
--- a/gtk/gtkfilechooserdialog.c
+++ b/gtk/gtkfilechooserdialog.c
@@ -51,7 +51,6 @@ static void     gtk_file_chooser_dialog_get_property (GObject               *obj
 						      GParamSpec            *pspec);
 
 static void     gtk_file_chooser_dialog_map          (GtkWidget             *widget);
-static void     gtk_file_chooser_dialog_unmap        (GtkWidget             *widget);
 
 static void response_cb (GtkDialog *dialog,
 			 gint       response_id);
@@ -72,7 +71,6 @@ gtk_file_chooser_dialog_class_init (GtkFileChooserDialogClass *class)
   gobject_class->finalize = gtk_file_chooser_dialog_finalize;
 
   widget_class->map       = gtk_file_chooser_dialog_map;
-  widget_class->unmap     = gtk_file_chooser_dialog_unmap;
 
   _gtk_file_chooser_install_properties (gobject_class);
 
@@ -371,32 +369,11 @@ gtk_file_chooser_dialog_map (GtkWidget *widget)
 
   ensure_default_response (dialog);
 
-  if (!gtk_widget_get_mapped (priv->widget))
-    gtk_widget_map (priv->widget);
-
   _gtk_file_chooser_embed_initial_focus (GTK_FILE_CHOOSER_EMBED (priv->widget));
 
   GTK_WIDGET_CLASS (gtk_file_chooser_dialog_parent_class)->map (widget);
 }
 
-/* GtkWidget::unmap handler */
-static void
-gtk_file_chooser_dialog_unmap (GtkWidget *widget)
-{
-  GtkFileChooserDialog *dialog = GTK_FILE_CHOOSER_DIALOG (widget);
-  GtkFileChooserDialogPrivate *priv = GTK_FILE_CHOOSER_DIALOG_GET_PRIVATE (dialog);
-
-  GTK_WIDGET_CLASS (gtk_file_chooser_dialog_parent_class)->unmap (widget);
-
-  /* See bug #145470.  We unmap the GtkFileChooserWidget so that if the dialog
-   * is remapped, the widget will be remapped as well.  Implementations should
-   * refresh their contents when this happens, as some applications keep a
-   * single file chooser alive and map/unmap it as needed, rather than creating
-   * a new file chooser every time they need one.
-   */
-  gtk_widget_unmap (priv->widget);
-}
-
 /* GtkDialog::response handler */
 static void
 response_cb (GtkDialog *dialog,



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