--- client.c.orig	2004-01-08 19:57:12.000000000 -0700
+++ client.c	2004-01-08 19:59:28.000000000 -0700
@@ -5711,7 +5711,7 @@
                 {
                     /* Redraw frame draw */
                     clientDrawOutline (passdata->c);
-                    tabwinSetLabel (passdata->tabwin, passdata->c->name);
+                    tabwinUpdate (passdata->tabwin, passdata->c);
                 }
                 else
                 {
@@ -5810,7 +5810,7 @@
     passdata.c = clientGetNext (c, passdata.cycle_range);
     if (passdata.c)
     {
-        passdata.tabwin = tabwinCreate (passdata.c->name);
+        passdata.tabwin = tabwinCreate (passdata.c, passdata.cycle_range);
         TRACE ("entering cycle loop");
         /* Draw frame draw */
         clientDrawOutline (passdata.c);
--- tabwin.h.orig	2004-01-08 19:56:25.000000000 -0700
+++ tabwin.h	2004-01-08 19:59:28.000000000 -0700
@@ -29,15 +29,57 @@
 #include <gdk/gdkx.h>
 #include <gtk/gtk.h>
 
+#include "main.h"
+#include "client.h"
+#include "netk-xutils.h"
+
+#define TABWIN_MAX_ICONS 10
+
 typedef struct _Tabwin Tabwin;
 struct _Tabwin
 {
     GtkWidget *window;
     GtkWidget *label;
+	XfceIconbutton *iconbuttons[TABWIN_MAX_ICONS];
+	Window icon_window_lookup[TABWIN_MAX_ICONS];
+	guint icon_count;
+	GdkColor normal_color;
+	GdkColor hilite_color;
+};
+
+typedef enum
+{
+    /* These MUST be in ascending order of preference;
+     * i.e. if we get _NET_WM_ICON and already have
+     * WM_HINTS, we prefer _NET_WM_ICON
+     */
+    USING_NO_ICON,
+    USING_FALLBACK_ICON,
+    USING_KWM_WIN_ICON,
+    USING_WM_HINTS,
+    USING_NET_WM_ICON
+}
+IconOrigin;
+
+struct _NetkIconCache
+{
+    IconOrigin origin;
+    Pixmap prev_pixmap;
+    Pixmap prev_mask;
+    GdkPixbuf *icon;
+    GdkPixbuf *mini_icon;
+    int ideal_width;
+    int ideal_height;
+    int ideal_mini_width;
+    int ideal_mini_height;
+    guint want_fallback:1;
+    guint wm_hints_dirty:1;
+    guint kwm_win_icon_dirty:1;
+    guint net_wm_icon_dirty:1;
 };
 
-Tabwin *tabwinCreate (gchar * label);
-void tabwinSetLabel (Tabwin * tabwin, gchar * label);
+Tabwin *tabwinCreate (Client * client, int cycle_range);
+void tabwinUpdate (Tabwin * tabwin, Client * client);
 void tabwinDestroy (Tabwin * tabwin);
 
 #endif /* INC_TABWIN_H */
--- tabwin.c.orig	2004-01-08 19:56:20.000000000 -0700
+++ tabwin.c	2004-01-08 19:59:28.000000000 -0700
@@ -32,7 +32,7 @@
 #include "tabwin.h"
 
 Tabwin *
-tabwinCreate (gchar * label)
+tabwinCreate (Client * client, int cycle_range)
 {
     static GdkPixbuf *icon = NULL;
     Tabwin *tabwin;
@@ -41,6 +41,7 @@
     GtkWidget *header;
 
     tabwin = g_new (Tabwin, 1);
+	tabwin->icon_count = 0;
 
     if (!icon)
     {
@@ -77,37 +78,109 @@
     gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
     gtk_widget_show (frame);
 
+	// Save the vbox so that we can add to it later...
+	GtkWidget *myvbox = vbox;
+
     vbox = gtk_vbox_new (FALSE, 0);
     gtk_widget_show (vbox);
     gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
     gtk_container_add (GTK_CONTAINER (frame), vbox);
 
     tabwin->label = gtk_label_new ("");
-    if (label)
+    if (client->name)
     {
-        tabwinSetLabel (tabwin, label);
+        gtk_label_set_text (GTK_LABEL (tabwin->label), client->name);
     }
     gtk_misc_set_alignment (GTK_MISC (tabwin->label), 0.5, 0.5);
     gtk_widget_show (tabwin->label);
     gtk_box_pack_start (GTK_BOX (vbox), tabwin->label, FALSE, TRUE, 0);
     gtk_widget_show (tabwin->window);
 
+    frame = gtk_frame_new (NULL);
+    gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_ETCHED_IN);
+    gtk_container_set_border_width (GTK_CONTAINER (frame), 0);
+	gtk_box_pack_start(GTK_BOX (myvbox), frame, TRUE, TRUE, 0);
+    gtk_widget_show (frame);
+
+    GtkWidget *hbox = gtk_hbox_new (FALSE, 5);
+    gtk_widget_show (hbox);
+    gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
+    gtk_container_add (GTK_CONTAINER (frame), hbox);
+
+
+	// Now put icons for the other "good" windows in the box...
+	GtkStyle *pStyle = gtk_widget_get_style(GTK_WIDGET(tabwin->window));
+	tabwin->normal_color = pStyle->bg[GTK_STATE_ACTIVE];
+	tabwin->hilite_color.red = 0.65 * tabwin->normal_color.red;
+	tabwin->hilite_color.green = 0.65 * tabwin->normal_color.green;
+	tabwin->hilite_color.blue = tabwin->normal_color.blue;
+
+	Client *this_client = client;
+	int button_num = 0;
+
+	XfceIconbutton *pButton;
+	NetkIconCache *icon_cache;
+	guchar *pixdata;
+	GdkPixbuf *pIcon, *pMiniIcon;
+
+	while ((button_num == 0 || (this_client != client)) && button_num < TABWIN_MAX_ICONS)
+	{
+ 		icon_cache = p_netk_icon_cache_new();
+
+		p_netk_read_icons(this_client->window, icon_cache, &pIcon, 32, 32, &pMiniIcon, 16, 16);
+
+		pButton = XFCE_ICONBUTTON(xfce_iconbutton_new());
+		if (pIcon)
+		{
+			xfce_iconbutton_set_pixbuf(pButton, pIcon);
+		}
+		if (button_num == 0)
+		{
+			gtk_widget_modify_bg(GTK_WIDGET (pButton), GTK_STATE_NORMAL, &tabwin->hilite_color);
+		}
+//		gtk_button_set_relief(GTK_BUTTON(pButton), GTK_RELIEF_NONE);
+		gtk_widget_show (GTK_WIDGET (pButton));
+		gtk_box_pack_start (GTK_BOX (hbox), GTK_WIDGET (pButton), TRUE, TRUE, 0);
+
+		tabwin->iconbuttons[button_num] = pButton;
+		tabwin->icon_window_lookup[button_num] = this_client->window;
+
+		this_client = clientGetNext(this_client, cycle_range);
+		button_num++;
+	}
+
+	tabwin->icon_count = button_num;
+
     return tabwin;
 }
 
 void
-tabwinSetLabel (Tabwin * tabwin, gchar * label)
+tabwinUpdate (Tabwin * tabwin, Client * client)
 {
     g_return_if_fail (tabwin != NULL);
 
-    if (label)
+    if (client->name)
     {
-        gtk_label_set_text (GTK_LABEL (tabwin->label), label);
+        gtk_label_set_text (GTK_LABEL (tabwin->label), client->name);
     }
     else
     {
         gtk_label_set_text (GTK_LABEL (tabwin->label), "");
     }
+
+	guint i;
+	for (i = 0; i < tabwin->icon_count; i++)
+	{
+		if (tabwin->icon_window_lookup[i] == client->window)
+		{
+			gtk_widget_modify_bg(GTK_WIDGET (tabwin->iconbuttons[i]), GTK_STATE_NORMAL, &tabwin->hilite_color);
+		}
+		else
+		{
+			gtk_widget_modify_bg(GTK_WIDGET (tabwin->iconbuttons[i]), GTK_STATE_NORMAL, &tabwin->normal_color);
+		}
+	}
+
     gtk_widget_queue_draw (tabwin->window);
 }
 
--- netk-xutils.h.orig	1969-12-31 17:00:00.000000000 -0700
+++ netk-xutils.h	2004-01-08 19:59:28.000000000 -0700
@@ -0,0 +1,154 @@
+/* Xlib utilities */
+
+/*
+ * Copyright (C) 2001 Havoc Pennington
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef NETK_XUTILS_H
+#define NETK_XUTILS_H
+
+#include <glib.h>
+#include <X11/Xlib.h>
+#include <X11/Xatom.h>
+#include <X11/Xmd.h>
+#include <gdk/gdk.h>
+#include <gdk/gdkx.h>
+
+#include <libxfcegui4/netk-window.h>
+
+G_BEGIN_DECLS
+
+#define NETK_APP_WINDOW_EVENT_MASK (PropertyChangeMask | StructureNotifyMask)
+
+typedef struct p_DesktopMargins
+{
+    int left;
+    int top;
+    int right;
+    int bottom;
+}
+p_DesktopMargins;
+
+gboolean p_netk_get_cardinal (Window xwindow, Atom atom, int *val);
+int p_netk_get_wm_state (Window xwindow);
+gboolean p_netk_get_window (Window xwindow, Atom atom, Window * val);
+gboolean p_netk_get_pixmap (Window xwindow, Atom atom, Pixmap * val);
+gboolean p_netk_get_atom (Window xwindow, Atom atom, Atom * val);
+char *p_netk_get_text_property (Window xwindow, Atom atom);
+char *p_netk_get_utf8_property (Window xwindow, Atom atom);
+gboolean p_netk_get_window_list (Window xwindow, Atom atom, Window ** windows,
+                                 int *len);
+gboolean p_netk_get_atom_list (Window xwindow, Atom atom, Atom ** atoms,
+                               int *len);
+gboolean p_netk_get_cardinal_list (Window xwindow, Atom atom,
+                                   gulong ** cardinals, int *len);
+char **p_netk_get_utf8_list (Window xwindow, Atom atom);
+void p_netk_set_utf8_list (Window xwindow, Atom atom, char **list);
+
+void p_netk_error_trap_push (void);
+int p_netk_error_trap_pop (void);
+
+Atom p_netk_atom_get (const char *atom_name);
+const char *p_netk_atom_name (Atom atom);
+
+void p_netk_event_filter_init (void);
+
+int p_netk_xid_equal (gconstpointer v1, gconstpointer v2);
+guint p_netk_xid_hash (gconstpointer v);
+
+void p_netk_iconify (Window xwindow);
+void p_netk_deiconify (Window xwindow);
+
+void p_netk_close (Screen * screen, Window xwindow);
+
+void p_netk_change_state (Screen * screen, Window xwindow, gboolean add,
+                          Atom state1, Atom state2);
+void p_netk_change_workspace (Screen * screen, Window xwindow, int new_space);
+void p_netk_activate (Screen * screen, Window xwindow);
+void p_netk_activate_workspace (Screen * screen, int new_active_space);
+void p_netk_change_viewport (Screen * screen, int x, int y);
+
+Window p_netk_get_group_leader (Window xwindow);
+char *p_netk_get_session_id (Window xwindow);
+int p_netk_get_pid (Window xwindow);
+char *p_netk_get_name (Window xwindow);
+char *p_netk_get_res_class_utf8 (Window xwindow);
+
+void p_netk_select_input (Window xwindow, int mask);
+
+void p_netk_keyboard_move (Screen * screen, Window xwindow);
+
+void p_netk_keyboard_size (Screen * screen, Window xwindow);
+void p_netk_toggle_showing_desktop (Screen * screen, gboolean show);
+
+typedef struct _NetkIconCache NetkIconCache;
+
+NetkIconCache *p_netk_icon_cache_new (void);
+void p_netk_icon_cache_free (NetkIconCache * icon_cache);
+void p_netk_icon_cache_property_changed (NetkIconCache * icon_cache,
+                                         Atom atom);
+gboolean p_netk_icon_cache_get_icon_invalidated (NetkIconCache * icon_cache);
+void p_netk_icon_cache_set_want_fallback (NetkIconCache * icon_cache,
+                                          gboolean setting);
+gboolean p_netk_icon_cache_get_is_fallback (NetkIconCache * icon_cache);
+
+gboolean p_netk_read_icons (Window xwindow, NetkIconCache * icon_cache,
+                            GdkPixbuf ** iconp, int ideal_width,
+                            int ideal_height, GdkPixbuf ** mini_iconp,
+                            int ideal_mini_width, int ideal_mini_height);
+void p_netk_get_fallback_icons (GdkPixbuf ** iconp, int ideal_width,
+                                int ideal_height, GdkPixbuf ** mini_iconp,
+                                int ideal_mini_width, int ideal_mini_height);
+
+
+
+void p_netk_get_window_geometry (Screen * screen, Window xwindow, int *xp,
+                                 int *yp, int *widthp, int *heightp);
+
+void p_netk_get_window_position (Screen * screen, Window xwindow, int *xp,
+                                 int *yp);
+
+void p_netk_set_icon_geometry (Window xwindow, int x, int y, int width,
+                               int height);
+
+/* p_netk_set_dock_type_hint() kept for backward compat */
+#define p_netk_set_dock_type_hint (w) \
+        p_netk_set_type_hint (w, NETK_WINDOW_DOCK)
+void p_netk_set_type_hint (Window xwindow, NetkWindowType type);
+
+void p_netk_set_desktop_layout (Screen * xscreen, int rows, int columns);
+
+GdkPixbuf *p_netk_gdk_pixbuf_get_from_pixmap (GdkPixbuf * dest,
+                                              Pixmap xpixmap, int src_x,
+                                              int src_y, int dest_x,
+                                              int dest_y, int width,
+                                              int height);
+
+#define NETK_NO_MANAGER_TOKEN 0
+
+int p_netk_try_desktop_layout_manager (Screen * xscreen, int current_token);
+void p_netk_release_desktop_layout_manager (Screen * xscreen,
+                                            int current_token);
+gboolean p_netk_desktop_layout_manager_process_event (XEvent * xev);
+
+gboolean p_netk_get_desktop_margins (Screen * xscreen,
+                                     p_DesktopMargins * margins);
+void p_netk_set_desktop_margins (Window xwindow, p_DesktopMargins * margins);
+
+G_END_DECLS
+#endif /* NETK_XUTILS_H */
