[Xfce4-commits] <xfce4-panel:master> Use gtk_widget_get_ancestor() instead of custom function.

Nick Schermer noreply at xfce.org
Sun Mar 28 18:24:03 CEST 2010


Updating branch refs/heads/master
         to d3f0e1e91077ee298dd387ce388c6597f48ca6f8 (commit)
       from f6bda093df202543d93c2097ec74e22e361f8749 (commit)

commit d3f0e1e91077ee298dd387ce388c6597f48ca6f8
Author: Nick Schermer <nick at xfce.org>
Date:   Sun Mar 28 18:20:21 2010 +0200

    Use gtk_widget_get_ancestor() instead of custom function.

 plugins/tasklist/tasklist-widget.c |   20 ++------------------
 1 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
index ab155ac..d32ef37 100644
--- a/plugins/tasklist/tasklist-widget.c
+++ b/plugins/tasklist/tasklist-widget.c
@@ -67,6 +67,8 @@
                                          } G_STMT_END
 #define xfce_taskbar_is_locked(tasklist) (XFCE_TASKLIST (tasklist)->locked > 0)
 
+#define xfce_tasklist_get_panel_plugin(tasklist) gtk_widget_get_ancestor (GTK_WIDGET (tasklist), XFCE_TYPE_PANEL_PLUGIN)
+
 
 
 enum
@@ -234,7 +236,6 @@ static void xfce_tasklist_window_removed (WnckScreen *screen, WnckWindow *window
 static void xfce_tasklist_viewports_changed (WnckScreen *screen, XfceTasklist *tasklist);
 static void xfce_tasklist_skipped_windows_state_changed (WnckWindow *window, WnckWindowState changed_state, WnckWindowState new_state, XfceTasklist *tasklist);
 static void xfce_tasklist_sort (XfceTasklist *tasklist);
-static GtkWidget *xfce_tasklist_get_panel_plugin (XfceTasklist *tasklist);
 static gboolean xfce_tasklist_update_icon_geometries (gpointer data);
 static void xfce_tasklist_update_icon_geometries_destroyed (gpointer data);
 
@@ -1571,23 +1572,6 @@ xfce_tasklist_sort (XfceTasklist *tasklist)
 
 
 
-static GtkWidget *
-xfce_tasklist_get_panel_plugin (XfceTasklist *tasklist)
-{
-  GtkWidget *p;
-
-  panel_return_val_if_fail (XFCE_IS_TASKLIST (tasklist), NULL);
-
-  /* look in the parents for the panel plugin */
-  for (p = GTK_WIDGET (tasklist); p != NULL; p = gtk_widget_get_parent (p))
-    if (g_type_is_a (G_OBJECT_TYPE (p), XFCE_TYPE_PANEL_PLUGIN))
-      return p;
-
-  return NULL;
-}
-
-
-
 static gboolean
 xfce_tasklist_update_icon_geometries (gpointer data)
 {



More information about the Xfce4-commits mailing list