gtk+ r19843 - trunk/gtk



Author: federico
Date: Thu Mar 13 00:43:36 2008
New Revision: 19843
URL: http://svn.gnome.org/viewvc/gtk+?rev=19843&view=rev

Log:
Destroy the completion feedback window

Signed-off-by: Federico Mena Quintero <federico gnu org>


Modified:
   trunk/gtk/gtkfilechooserentry.c

Modified: trunk/gtk/gtkfilechooserentry.c
==============================================================================
--- trunk/gtk/gtkfilechooserentry.c	(original)
+++ trunk/gtk/gtkfilechooserentry.c	Thu Mar 13 00:43:36 2008
@@ -92,6 +92,7 @@
 static void     gtk_file_chooser_entry_finalize       (GObject          *object);
 static void     gtk_file_chooser_entry_dispose        (GObject          *object);
 static void     gtk_file_chooser_entry_grab_focus     (GtkWidget        *widget);
+static void     gtk_file_chooser_entry_unmap          (GtkWidget        *widget);
 static gboolean gtk_file_chooser_entry_focus          (GtkWidget        *widget,
 						       GtkDirectionType  direction);
 static gboolean gtk_file_chooser_entry_focus_out_event (GtkWidget       *widget,
@@ -164,6 +165,7 @@
   gobject_class->dispose = gtk_file_chooser_entry_dispose;
 
   widget_class->grab_focus = gtk_file_chooser_entry_grab_focus;
+  widget_class->unmap = gtk_file_chooser_entry_unmap;
   widget_class->focus = gtk_file_chooser_entry_focus;
   widget_class->focus_out_event = gtk_file_chooser_entry_focus_out_event;
 
@@ -235,6 +237,8 @@
 {
   GtkFileChooserEntry *chooser_entry = GTK_FILE_CHOOSER_ENTRY (object);
 
+  remove_completion_feedback (chooser_entry);
+
   if (chooser_entry->start_autocompletion_idle_id != 0)
     {
       g_source_remove (chooser_entry->start_autocompletion_idle_id);
@@ -760,6 +764,16 @@
   _gtk_file_chooser_entry_select_filename (GTK_FILE_CHOOSER_ENTRY (widget));
 }
 
+static void
+gtk_file_chooser_entry_unmap (GtkWidget *widget)
+{
+  GtkFileChooserEntry *chooser_entry = GTK_FILE_CHOOSER_ENTRY (widget);
+
+  remove_completion_feedback (chooser_entry);
+
+  GTK_WIDGET_CLASS (_gtk_file_chooser_entry_parent_class)->unmap (widget);
+}
+
 static gboolean
 completion_feedback_window_expose_event_cb (GtkWidget      *widget,
 					    GdkEventExpose *event,
@@ -859,9 +873,13 @@
 static void
 remove_completion_feedback (GtkFileChooserEntry *chooser_entry)
 {
-  /* FIXME */
+  if (chooser_entry->completion_feedback_window)
+    gtk_widget_destroy (chooser_entry->completion_feedback_window);
+
   chooser_entry->completion_feedback_window = NULL;
   chooser_entry->completion_feedback_label = NULL;
+
+  /* FIXME: remove timer */
 }
 
 static void



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