gnome-panel r11091 - trunk/applets/clock



Author: federico
Date: Thu May  8 22:56:08 2008
New Revision: 11091
URL: http://svn.gnome.org/viewvc/gnome-panel?rev=11091&view=rev

Log:
Pass the XID to clock_location_make_current()
2008-05-08  Federico Mena Quintero  <federico novell com>

	* clock-location.c (clock_location_make_current): Take in a
	transient_parent_xid argument.

	* clock.c (location_start_element): Pass the XID of the applet's
	window to clock_location_make_current().

	* clock-location-tile.c (make_current): Pass XID of the toplevel
	widget's window.

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


Modified:
   trunk/applets/clock/ChangeLog
   trunk/applets/clock/clock-location-tile.c
   trunk/applets/clock/clock-location.c
   trunk/applets/clock/clock-location.h
   trunk/applets/clock/clock.c

Modified: trunk/applets/clock/clock-location-tile.c
==============================================================================
--- trunk/applets/clock/clock-location-tile.c	(original)
+++ trunk/applets/clock/clock-location-tile.c	Thu May  8 22:56:08 2008
@@ -193,8 +193,17 @@
 make_current (GtkWidget *widget, ClockLocationTile *tile)
 {
         ClockLocationTilePrivate *priv = PRIVATE (tile);
+	GtkWidget *toplevel;
+	guint xid;
 
-	clock_location_make_current (priv->location, 
+	toplevel = gtk_widget_get_toplevel (GTK_WIDGET (tile));
+	if (toplevel && toplevel->window)
+		xid = GDK_WINDOW_XID (toplevel->window);
+	else
+		xid = NULL;
+
+	clock_location_make_current (priv->location,
+				     xid,
 				     (GFunc)make_current_cb, tile, NULL);
 }
 

Modified: trunk/applets/clock/clock-location.c
==============================================================================
--- trunk/applets/clock/clock-location.c	(original)
+++ trunk/applets/clock/clock-location.c	Thu May  8 22:56:08 2008
@@ -486,7 +486,8 @@
 }
 
 void
-clock_location_make_current (ClockLocation *loc, 
+clock_location_make_current (ClockLocation *loc,
+			     guint          transient_parent_xid,
                              GFunc          callback,
                              gpointer       data,
                              GDestroyNotify destroy)
@@ -526,7 +527,7 @@
 
         filename = g_build_filename (SYSTEM_ZONEINFODIR, priv->timezone, NULL);
         set_system_timezone_async (filename,
-				   0,
+				   transient_parent_xid,
                                    (GFunc)make_current_cb, 
 				   mcdata,
                                    free_make_current_data);

Modified: trunk/applets/clock/clock-location.h
==============================================================================
--- trunk/applets/clock/clock-location.h	(original)
+++ trunk/applets/clock/clock-location.h	Thu May  8 22:56:08 2008
@@ -59,7 +59,8 @@
 void clock_location_localtime (ClockLocation *loc, struct tm *tm);
 
 gboolean clock_location_is_current (ClockLocation *loc);
-void clock_location_make_current (ClockLocation *loc, 
+void clock_location_make_current (ClockLocation *loc,
+				  guint          transient_parent_xid,
 				  GFunc          callback,
 				  gpointer       data,
 				  GDestroyNotify destroy);

Modified: trunk/applets/clock/clock.c
==============================================================================
--- trunk/applets/clock/clock.c	(original)
+++ trunk/applets/clock/clock.c	Thu May  8 22:56:08 2008
@@ -46,6 +46,7 @@
 
 #include <gtk/gtk.h>
 #include <gdk/gdkkeysyms.h>
+#include <gdk/gdkx.h>
 #include <gconf/gconf-client.h>
 
 #include <glade/glade.h>
@@ -2215,7 +2216,7 @@
 					  latitude, longitude, code, &prefs);
 
 	if (current && clock_location_is_current_timezone (loc))
-		clock_location_make_current (loc, NULL, NULL, NULL);
+		clock_location_make_current (loc, GDK_WINDOW_XID (cd->applet->window), NULL, NULL, NULL);
 
         data->cities = g_list_append (data->cities, loc);
 }



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