? patch
Index: selector.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/selector.c,v
retrieving revision 1.1
diff -u -p -r1.1 selector.c
--- selector.c	25 Jan 2005 14:49:02 -0000	1.1
+++ selector.c	26 Jan 2005 14:38:14 -0000
@@ -26,6 +26,7 @@
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
+#include <glib.h>
 
 #include "selector.h"
 #include "inlinepixbufs.h"
@@ -52,7 +53,6 @@ struct _WnckSelectorPrivate {
   GHashTable *window_hash;
 
   int size;
-  WnckScreen *screen;
 };
 
 static void wnck_selector_init              (WnckSelector      *tasklist);
@@ -82,12 +82,8 @@ static WnckScreen *
 wnck_selector_get_screen (WnckSelector *selector)
 {
   GdkScreen *screen;
-  WnckSelectorPrivate *priv;
-
-  priv = WNCK_SELECTOR_GET_PRIVATE (selector);
-  if (!gtk_widget_has_screen (GTK_WIDGET (selector)))
-    return priv->screen;
 
+  g_assert (gtk_widget_has_screen (GTK_WIDGET (selector)));
   screen = gtk_widget_get_screen (GTK_WIDGET (selector));
 
   return wnck_screen_get (gdk_screen_get_number (screen));
@@ -622,27 +618,6 @@ wnck_selector_on_show (GtkWidget *widget
 }
 
 static void
-wnck_selector_setup_menu (WnckSelector *selector)
-{
-  WnckScreen *screen;
-  GList *windows, *l;
-
-  screen = wnck_selector_get_screen (selector);
-  windows = wnck_screen_get_windows (screen);
-
-  for (l = windows; l; l = l->next)
-    if (wnck_window_is_active (l->data))
-      break;
-
-  wnck_selector_set_active_window (selector, l ? l->data : NULL);
-
-  for (l = windows; l; l = l->next)
-    wnck_selector_connect_to_window (selector, l->data);
-
-  wnck_selector_connect_to_screen (selector, screen);
-}
-
-static void
 wnck_selector_fill (WnckSelector *selector)
 {
   WnckSelectorPrivate *priv = WNCK_SELECTOR_GET_PRIVATE (selector);
@@ -677,7 +652,6 @@ wnck_selector_fill (WnckSelector *select
                        "}\n"
                        "widget \"*gnome-panel-window-menu-menu-bar*\" style : highest \"gnome-panel-window-menu-menu-bar-style\"");
 
-  wnck_selector_setup_menu (selector);
   gtk_widget_show (GTK_WIDGET (selector));
 }
 
@@ -751,7 +725,7 @@ wnck_selector_new (WnckScreen *screen)
   WnckSelectorPrivate *priv;
   selector = g_object_new (WNCK_TYPE_SELECTOR, NULL);
   priv = WNCK_SELECTOR_GET_PRIVATE (selector);
-  priv->screen = screen;
   wnck_selector_fill (selector);
+  wnck_selector_connect_to_screen (selector, screen);
   return GTK_WIDGET (selector);
 }
