2009-01-23 Alberto Garcia <agarcia@igalia.com>
authorAlberto Garcia <agarcia@igalia.com>
Fri, 23 Jan 2009 19:47:05 +0000 (19:47 +0000)
committerAlberto Garcia <agarcia@igalia.com>
Fri, 23 Jan 2009 19:47:05 +0000 (19:47 +0000)
* src/hildon-banner.c (hildon_banner_button_press_event): Hide
banners instead of destroying them when they receive a button
press.

ChangeLog
src/hildon-banner.c

index 46e0ed1..596136c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-23  Alberto Garcia  <agarcia@igalia.com>
+
+       * src/hildon-banner.c (hildon_banner_button_press_event): Hide
+       banners instead of destroying them when they receive a button
+       press.
+
 2009-01-23  Alejandro G. Castro  <alex@igalia.com>
 
        Reverted commit 34028, it was causing regressions, probably the
index 03fe7c2..6864342 100644 (file)
@@ -546,15 +546,18 @@ static gboolean
 hildon_banner_button_press_event                (GtkWidget* widget,
                                                 GdkEventButton* event)
 {
-       gboolean result = simulate_close (widget);
-
-       if (!result) {
-               /* signal emission not stopped - basically behave like
-                * gtk_main_do_event() for a delete event */
-               gtk_widget_destroy (widget);
-       }
+    gboolean result = simulate_close (widget);
+
+    if (!result) {
+        /* signal emission not stopped - basically behave like
+         * gtk_main_do_event() for a delete event, but just hide the
+         * banner instead of destroying it, as it is already meant to
+         * be destroyed by hildon_banner_timeout() (if it's timed) or
+         * the application (if it's not). */
+        gtk_widget_hide (widget);
+    }
 
-       return result;
+    return result;
 }
 
 /* We start the timer for timed notifications after the window appears on screen */