[gnome-panel/gtk3] clock: Remove unused xid parameter of clock_location_make_current()



commit 968d6127aabfb933daa5984861d590730bbe029b
Author: Carlos Garcia Campos <carlosgc gnome org>
Date:   Sun Jan 30 11:36:28 2011 +0100

    clock: Remove unused xid parameter of clock_location_make_current()
    
    It causes a crash when getting the xid of the window before the applet
    is realized. Checking if the applet is realized before calling
    get_window() would fix the issue, but since the xid parameter is not
    used anyway.

 applets/clock/clock-location-tile.c |   13 -------------
 applets/clock/clock-location.c      |    1 -
 applets/clock/clock-location.h      |    1 -
 applets/clock/clock.c               |    3 +--
 4 files changed, 1 insertions(+), 17 deletions(-)
---
diff --git a/applets/clock/clock-location-tile.c b/applets/clock/clock-location-tile.c
index 5e6ba93..183e7e0 100644
--- a/applets/clock/clock-location-tile.c
+++ b/applets/clock/clock-location-tile.c
@@ -194,21 +194,8 @@ static void
 make_current (GtkWidget *widget, ClockLocationTile *tile)
 {
         ClockLocationTilePrivate *priv = PRIVATE (tile);
-	GtkWidget *toplevel;
-	guint xid;
-
-	xid = 0;
-	toplevel = gtk_widget_get_toplevel (GTK_WIDGET (tile));
-
-	if (toplevel) {
-		GdkWindow *window = gtk_widget_get_window (toplevel);
-
-		if (window)
-			xid = GDK_WINDOW_XID (window);
-	}
 
 	clock_location_make_current (priv->location,
-				     xid,
 				     (GFunc)make_current_cb, tile, NULL);
 }
 
diff --git a/applets/clock/clock-location.c b/applets/clock/clock-location.c
index 7117c25..ebcb5de 100644
--- a/applets/clock/clock-location.c
+++ b/applets/clock/clock-location.c
@@ -537,7 +537,6 @@ free_make_current_data (gpointer data)
 
 void
 clock_location_make_current (ClockLocation *loc,
-			     guint          transient_parent_xid,
                              GFunc          callback,
                              gpointer       data,
                              GDestroyNotify destroy)
diff --git a/applets/clock/clock-location.h b/applets/clock/clock-location.h
index 59cb423..2b25d97 100644
--- a/applets/clock/clock-location.h
+++ b/applets/clock/clock-location.h
@@ -65,7 +65,6 @@ void clock_location_localtime (ClockLocation *loc, struct tm *tm);
 
 gboolean clock_location_is_current (ClockLocation *loc);
 void clock_location_make_current (ClockLocation *loc,
-				  guint          transient_parent_xid,
 				  GFunc          callback,
 				  gpointer       data,
 				  GDestroyNotify destroy);
diff --git a/applets/clock/clock.c b/applets/clock/clock.c
index b8e7892..39d2079 100644
--- a/applets/clock/clock.c
+++ b/applets/clock/clock.c
@@ -2204,8 +2204,7 @@ location_start_element (GMarkupParseContext *context,
 					  latitude, longitude, code, &prefs);
 
 	if (current && clock_location_is_current_timezone (loc))
-		clock_location_make_current (loc, GDK_WINDOW_XID (gtk_widget_get_window (cd->applet)),
-					     NULL, NULL, NULL);
+		clock_location_make_current (loc, 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]