[maemo-commits] [maemo-commits] r12034 - in projects/haf/trunk/hildon-1: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Jun 1 14:20:00 EEST 2007
Author: mdk
Date: 2007-06-01 14:19:43 +0300 (Fri, 01 Jun 2007)
New Revision: 12034

Modified:
   projects/haf/trunk/hildon-1/ChangeLog
   projects/haf/trunk/hildon-1/src/hildon-banner.c
Log:
When realizing the widget, set the window transiency. 


Modified: projects/haf/trunk/hildon-1/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-1/ChangeLog	2007-06-01 11:03:25 UTC (rev 12033)
+++ projects/haf/trunk/hildon-1/ChangeLog	2007-06-01 11:19:43 UTC (rev 12034)
@@ -1,3 +1,9 @@
+2007-06-01  Michael Dominic Kostrzewa  <michael.kostrzewa at nokia.com> 
+
+	* src/hildon-banner.c: When realizing the widget, set the window
+	transiency. Setting the transiency in the gobject constructor is not
+	good, as the widget is not realized at that point. Fixes: #NB56624.
+
 2007-05-30  Xan Lopez  <xan.lopez at nokia.com>
 
 	* src/hildon-bread-crumb-trail.h (struct _HildonBreadCrumbTrailClass):

Modified: projects/haf/trunk/hildon-1/src/hildon-banner.c
===================================================================
--- projects/haf/trunk/hildon-1/src/hildon-banner.c	2007-06-01 11:03:25 UTC (rev 12033)
+++ projects/haf/trunk/hildon-1/src/hildon-banner.c	2007-06-01 11:19:43 UTC (rev 12034)
@@ -131,7 +131,7 @@
                                                  GObjectConstructParam *construct_params);
 
 static void
-hildon_banner_finalize				(GObject *object);
+hildon_banner_finalize                          (GObject *object);
 
 static gboolean 
 hildon_banner_map_event                         (GtkWidget *widget, 
@@ -399,17 +399,17 @@
 
         case PROP_PARENT_WINDOW:
             window = g_value_get_object (value);         
-	    if (priv->parent) {
-		    g_object_remove_weak_pointer(G_OBJECT (priv->parent), (gpointer) &priv->parent);
-	    }
+            if (priv->parent) {
+                g_object_remove_weak_pointer(G_OBJECT (priv->parent), (gpointer) &priv->parent);
+            }
 
             gtk_window_set_transient_for (GTK_WINDOW (object), (GtkWindow *) window);
             priv->parent = (GtkWindow *) window;
 
             if (window) {
                 gtk_window_set_destroy_with_parent (GTK_WINDOW (object), TRUE);
-		g_object_add_weak_pointer(G_OBJECT (window), (gpointer) &priv->parent);
-	    }
+                g_object_add_weak_pointer(G_OBJECT (window), (gpointer) &priv->parent);
+            }
 
             break;
 
@@ -556,12 +556,12 @@
 }
 
 static void
-hildon_banner_finalize				(GObject *object)
+hildon_banner_finalize                          (GObject *object)
 {
     HildonBannerPrivate *priv = HILDON_BANNER_GET_PRIVATE (object);
 
     if (priv->parent) {
-	g_object_remove_weak_pointer(G_OBJECT (priv->parent), (gpointer) &priv->parent);
+    g_object_remove_weak_pointer(G_OBJECT (priv->parent), (gpointer) &priv->parent);
     }
 
     G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -644,12 +644,16 @@
 static void
 hildon_banner_realize                           (GtkWidget *widget)
 {
+    HildonBannerPrivate *priv = HILDON_BANNER_GET_PRIVATE (widget);
+    g_assert (priv);
+
     /* We let the parent to init widget->window before we need it */
     if (GTK_WIDGET_CLASS (parent_class)->realize)
         GTK_WIDGET_CLASS (parent_class)->realize (widget);
 
     /* We use special hint to turn the banner into information notification. */
     gdk_window_set_type_hint (widget->window, GDK_WINDOW_TYPE_HINT_NOTIFICATION);
+    gtk_window_set_transient_for (GTK_WINDOW (widget), (GtkWindow *) priv->parent);
 
     hildon_banner_check_position (widget);
 }


More information about the maemo-commits mailing list