Index: src/metacity-dialog.c
===================================================================
--- src/metacity-dialog.c	(Revision 3014)
+++ src/metacity-dialog.c	(Arbeitskopie)
@@ -145,154 +145,6 @@ latin1_to_utf8 (const char *text)
   return g_string_free (str, FALSE);
 }
 
-enum
-{
-  COLUMN_TITLE,
-  COLUMN_CLASS,
-  COLUMN_LAST
-};
-
-static GtkWidget*
-create_lame_apps_list (char **lame_apps)
-{
-  GtkTreeSelection *selection;
-  GtkCellRenderer *cell;
-  GtkWidget *tree_view;
-  GtkTreeViewColumn *column;
-  GtkListStore *model;
-  GtkTreeIter iter;
-  int i;
-  
-  model = gtk_list_store_new (COLUMN_LAST,
-                              G_TYPE_STRING,
-                              G_TYPE_STRING);
-  
-  tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
-
-  g_object_unref (G_OBJECT (model));
-  
-  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view));
-
-  gtk_tree_selection_set_mode (GTK_TREE_SELECTION (selection),
-			       GTK_SELECTION_NONE);
-
-  i = 0;
-  while (lame_apps[i])
-    {
-      char *s;
-      
-      gtk_list_store_append (model, &iter);
-
-      /* window class is latin-1 */
-      s = latin1_to_utf8 (lame_apps[i+1]);
-      
-      gtk_list_store_set (model,
-			  &iter,
-                          COLUMN_TITLE, lame_apps[i],
-                          COLUMN_CLASS, s,
-                          -1);
-
-      g_free (s);
-      
-      i += 2;
-    }
-  
-  cell = gtk_cell_renderer_text_new ();
-  
-  g_object_set (G_OBJECT (cell),
-                "xpad", 2,
-                NULL);
-  
-  column = gtk_tree_view_column_new_with_attributes (_("Title"),
-						     cell,
-						     "text", COLUMN_TITLE,
-						     NULL);
-
-  gtk_tree_view_column_set_sort_column_id (column, COLUMN_TITLE);
-  
-  gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
-			       GTK_TREE_VIEW_COLUMN (column));
-
-  cell = gtk_cell_renderer_text_new ();
-  
-  column = gtk_tree_view_column_new_with_attributes (_("Class"),
-						     cell,
-						     "text", COLUMN_CLASS,
-						     NULL);
-
-  gtk_tree_view_column_set_sort_column_id (column, COLUMN_CLASS);
-  
-  gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view),
-			       GTK_TREE_VIEW_COLUMN (column));
-
-  return tree_view;
-}
-
-static int
-warn_about_no_sm_support (char    **lame_apps,
-                          guint32   timestamp)
-{
-  GtkWidget *dialog;
-  GtkWidget *list;
-  GtkWidget *sw;
-  GtkWidget *button;
-      
-  dialog = gtk_message_dialog_new (NULL,
-                                   0,
-                                   GTK_MESSAGE_WARNING,
-                                   GTK_BUTTONS_NONE,
-                                   _("These windows do not support \"save current setup\" and will have to be restarted manually next time you log in."));
-  gtk_window_set_icon_name (GTK_WINDOW (dialog), "stock_dialog-warning");
-  
-  g_signal_connect (G_OBJECT (dialog),
-                    "response",
-                    G_CALLBACK (gtk_main_quit),
-                    NULL);
-
-  /* Wait 4 minutes then force quit, so we don't wait around all night */
-  g_timeout_add (4 * 60 * 1000, (GSourceFunc) gtk_main_quit, NULL);
-
-  button = gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
-  gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CLOSE);
-  list = create_lame_apps_list (lame_apps);
-
-  sw = gtk_scrolled_window_new (NULL, NULL);
-  gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
-                                  GTK_POLICY_AUTOMATIC,
-                                  GTK_POLICY_AUTOMATIC);
-  gtk_container_set_border_width (GTK_CONTAINER (sw), 3);
-      
-  gtk_container_add (GTK_CONTAINER (sw), list);
-
-  /* sw as geometry widget */
-  gtk_window_set_geometry_hints (GTK_WINDOW (dialog),
-                                 sw, NULL, 0);
-
-  gtk_window_set_resizable (GTK_WINDOW(dialog), TRUE);
-
-  /* applies to geometry widget; try to avoid scrollbars,
-   * but don't make the window huge
-   */
-  gtk_window_set_default_size (GTK_WINDOW (dialog),
-                               400, 225);
-
-  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
-                      sw,
-                      TRUE, TRUE, 0);
-  
-  gtk_window_stick (GTK_WINDOW (dialog));
-
-  gtk_widget_realize (dialog);
-  gdk_x11_window_set_user_time (dialog->window, timestamp);
-
-  gtk_widget_grab_focus (button);
-  gtk_widget_show_all (dialog);
-
-  gtk_main ();
-  
-  return 0;
-}
-
 static int
 error_about_command (const char *gconf_key,
                      const char *command,
@@ -330,7 +182,6 @@ error_about_command (const char *gconf_k
 static gchar *screen = NULL;
 static gchar *timestamp_string = NULL;
 static gboolean isset_kill_window_question = FALSE;
-static gboolean isset_warn_about_no_sm_support = FALSE;
 static gboolean isset_command_failed_error = FALSE;
 static gchar **remaining_args;
 
@@ -339,8 +190,6 @@ static const GOptionEntry options[] = {
   { "timestamp", 0, 0, G_OPTION_ARG_STRING, &timestamp_string, NULL, NULL},
   { "kill-window-question", 'k', 0, G_OPTION_ARG_NONE, 
     &isset_kill_window_question, NULL, NULL},
-  { "warn-about-no-sm-support", 'w', 0, G_OPTION_ARG_NONE, 
-    &isset_warn_about_no_sm_support, NULL, NULL},
   { "command-failed-error", 'c', 0, G_OPTION_ARG_NONE, 
     &isset_command_failed_error, NULL, NULL},
   { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, 
@@ -377,9 +226,7 @@ main (int argc, char **argv)
       num_args = g_strv_length (remaining_args);
     }
 
-  if ((isset_kill_window_question && isset_warn_about_no_sm_support) ||
-      (isset_kill_window_question && isset_command_failed_error) ||
-      (isset_warn_about_no_sm_support && isset_command_failed_error) ||
+  if ((isset_kill_window_question && isset_command_failed_error) ||
       timestamp == 0) 
     {
       g_printerr ("bad args to metacity-dialog\n");
@@ -400,20 +247,6 @@ main (int argc, char **argv)
         }
     }
 
-  else if (isset_warn_about_no_sm_support)
-    {
-      /* argc must be even because we want title-class pairs */
-      if (num_args == 0 || (num_args % 2) != 0)
-        {
-          g_printerr ("bad args to metacity-dialog\n");
-          return 1;
-        } 
-      else 
-        {
-          return warn_about_no_sm_support (&remaining_args[0], timestamp);
-        }
-    }
-
   else if (isset_command_failed_error)
     {
       /* the args are the gconf key of the failed command, the text of
Index: src/session.c
===================================================================
--- src/session.c	(Revision 3014)
+++ src/session.c	(Arbeitskopie)
@@ -83,7 +83,7 @@ static char*       load_state         (c
 static void        regenerate_save_file (void);
 static const char* full_save_file       (void);
 static const char* base_save_file       (void);
-static void        warn_about_lame_clients_and_finish_interact (gboolean shutdown);
+static void        finish_interact (gboolean shutdown);
 
 /* This is called when data is available on an ICE connection.  */
 static gboolean
@@ -571,7 +571,7 @@ interact_callback (SmcConn smc_conn, SmP
 
   current_state = STATE_DONE_WITH_INTERACT;
 
-  warn_about_lame_clients_and_finish_interact (shutdown);
+  finish_interact (shutdown);
 }
 
 static void
@@ -1713,20 +1713,6 @@ base_save_file (void)
   return relative_save_path;
 }
 
-static int
-windows_cmp_by_title (MetaWindow *a,
-                      MetaWindow *b)
-{
-  return g_utf8_collate (a->title, b->title);
-}
-
-typedef struct
-{
-  int child_pid;
-  int child_pipe;
-  gboolean shutdown;
-} LameClientsDialogData;
-
 static void
 finish_interact (gboolean shutdown)
 {
@@ -1738,192 +1724,4 @@ finish_interact (gboolean shutdown)
     }
 }
 
-static gboolean  
-io_from_warning_dialog (GIOChannel   *channel,
-                        GIOCondition  condition,
-                        gpointer      data)
-{
-  LameClientsDialogData *d;
-
-  d = data;
-  
-  meta_topic (META_DEBUG_PING,
-              "IO handler from lame clients dialog, condition = %x\n",
-              condition);
-  
-  if (condition & (G_IO_HUP | G_IO_NVAL | G_IO_ERR))
-    {
-      finish_interact (d->shutdown);
-
-      /* Remove the callback, freeing data */
-      return FALSE; 
-    }
-  else if (condition & G_IO_IN)
-    {
-      /* Check for EOF */
-      
-      char buf[16];
-      int ret;
- 
-      ret = read (d->child_pipe, buf, sizeof (buf));
-      if (ret == 0)
- 	{
- 	  finish_interact (d->shutdown);
- 	  return FALSE;
- 	}
-    }
-
-  /* Keep callback installed */
-  return TRUE;
-}
-
-static void
-warn_about_lame_clients_and_finish_interact (gboolean shutdown)
-{
-  GSList *displays;
-  GSList *display_iter;  
-  GSList *lame;
-  char **argv;
-  int i;
-  GSList *tmp;
-  int len;
-  int child_pid;
-  int child_pipe;
-  GError *err;
-  GIOChannel *channel;
-  LameClientsDialogData *d;
-  guint32 timestamp;
-  char timestampbuf[32];
-  
-  lame = NULL;
-  displays = meta_displays_list ();
-  display_iter = displays;
-  while (display_iter != NULL)
-    {
-      GSList *windows;
-
-      windows = meta_display_list_windows (display_iter->data);
-      tmp = windows;
-      while (tmp != NULL)
-        {
-          MetaWindow *window;
-
-          window = tmp->data;
-
-          /* only complain about normal windows, the others
-           * are kind of dumb to worry about
-           */
-          if (window->sm_client_id == NULL &&
-              window->type == META_WINDOW_NORMAL)
-            lame = g_slist_prepend (lame, window);
-          
-          tmp = tmp->next;
-        }
-      
-      g_slist_free (windows);
-
-      display_iter = display_iter->next;
-    }
-  /* don't need to free displays */
-  displays = NULL;
-
-  if (lame == NULL)
-    {
-      /* No lame apps. */
-      finish_interact (shutdown);
-      return;
-    }
-  
-  lame = g_slist_sort (lame, (GCompareFunc) windows_cmp_by_title);
-
-  
-    {
-      XEvent property_event;
-      MetaDisplay *display;
-
-      display = meta_displays_list ()->data;
-
-      /* Using the property XA_PRIMARY because it's safe; nothing
-       * would use it as a property. The type doesn't matter.
-       */
-      XChangeProperty (display->xdisplay,
-                       display->leader_window,
-                       XA_PRIMARY, XA_STRING, 8,
-                       PropModeAppend, NULL, 0);
-      XWindowEvent (display->xdisplay,
-                    display->leader_window,
-                    PropertyChangeMask,
-                    &property_event);
-
-      timestamp = property_event.xproperty.time;
-    }
-  sprintf (timestampbuf, "%u", timestamp);
-
-  len = g_slist_length (lame);
-  len *= 2; /* titles and also classes */
-  len += 2; /* --timestamp flag and actual timestamp */
-  len += 1; /* NULL term */
-  len += 2; /* metacity-dialog command and option */
-  
-  argv = g_new0 (char*, len);
-  
-  i = 0;
-
-  argv[i] = METACITY_LIBEXECDIR"/metacity-dialog";
-  ++i;
-  argv[i] = "--timestamp";
-  ++i;
-  argv[i] = timestampbuf;
-  ++i;
-  argv[i] = "--warn-about-no-sm-support";
-  ++i;
-  
-  tmp = lame;
-  while (tmp != NULL)
-    {
-      MetaWindow *w = tmp->data;
-
-      argv[i] = w->title;
-      ++i;
-      argv[i] = w->res_class ? w->res_class : "";
-      ++i;
-
-      tmp = tmp->next;
-    }
-
-  child_pipe = -1;
-  child_pid = -1;
-  err = NULL;
-  if (!g_spawn_async_with_pipes ("/",
-                                 argv,
-                                 NULL,
-                                 0,
-                                 NULL, NULL,
-                                 &child_pid,
-                                 NULL,
-                                 &child_pipe,
-                                 NULL,
-                                 &err))
-    {
-      meta_warning (_("Error launching metacity-dialog to warn about apps that don't support session management: %s\n"),
-                    err->message);
-      g_error_free (err);
-    }
-
-  g_free (argv);
-  g_slist_free (lame);
-
-  d = g_new0 (LameClientsDialogData, 1);
-  d->child_pipe = child_pipe;
-  d->child_pid = child_pid;
-  d->shutdown = shutdown;
-  
-  channel = g_io_channel_unix_new (d->child_pipe);
-  g_io_add_watch_full (channel, G_PRIORITY_DEFAULT,
-                       G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
-                       io_from_warning_dialog,
-                       d, g_free);
-  g_io_channel_unref (channel);
-}
-
 #endif /* HAVE_SM */
