Index: libwnck/ChangeLog
===================================================================
RCS file: /export/cvs/gnome-2.0/libwnck/ChangeLog,v
retrieving revision 1.25
diff -p -u -5 -r1.25 ChangeLog
--- libwnck/ChangeLog	2002/06/13 22:37:03	1.25
+++ libwnck/ChangeLog	2002/06/14 14:09:41
@@ -1,5 +1,17 @@
+2002-06-14  Arvind Samptur <arvind.samptur@wipro.com>
+
+	* libwnck/tasklist.c 
+	(wnck_task_create_widgets): added drag_motion and drag_leave
+	signals.
+	(wnck_task_drag_motion): add a timer when the drag item is on
+        button. Timeout is set to 1 second.
+	(wnck_task_drag_leave):  remove the timer when leaving.
+	(wnck_task_motion_timeout): after the timeout activate the 
+	corresponding window.
+	Fixes #80736, for ungrouped windows.             
+
 2002-06-13  jacob berkman  <jacob@ximian.com>
 
 	* libwnck/tasklist.c (wnck_task_create_widgets): tell libgnomeui
 	not to do toggle sounds on ourself, as it's incredibly annoying to
 	have the tasklist beep every time you change focus.
Index: libwnck/libwnck/tasklist.c
===================================================================
RCS file: /export/cvs/gnome-2.0/libwnck/libwnck/tasklist.c,v
retrieving revision 1.10
diff -p -u -5 -r1.10 tasklist.c
--- libwnck/libwnck/tasklist.c	2002/06/13 22:37:03	1.10
+++ libwnck/libwnck/tasklist.c	2002/06/14 14:09:41
@@ -55,10 +55,12 @@ typedef struct _WnckTaskClass   WnckTask
 #define DEFAULT_GROUPING_LIMIT 80
 
 #define DEFAULT_WIDTH 1
 #define DEFAULT_HEIGHT 48
 
+#define TIMEOUT_ACTIVATE 1000
+
 struct _WnckTask
 {
   GObject parent_instance;
 
   WnckTasklist *tasklist;
@@ -84,10 +86,12 @@ struct _WnckTask
 
   /* task menu */
   GtkWidget *menu;
   /* ops menu */
   GtkWidget *action_menu;
+
+  guint button_activate;
 };
 
 struct _WnckTaskClass
 {
   GObjectClass parent_class;
@@ -1716,10 +1720,56 @@ wnck_task_app_name_changed (WnckApplicat
   if (task)
     wnck_task_update_visible_state (task);
 }
 
 static gboolean
+wnck_task_motion_timeout (gpointer data)
+{
+  WnckTask *task = WNCK_TASK (data);
+ 
+  gtk_timeout_remove (task->button_activate);
+  task->button_activate = 0;
+
+  wnck_window_activate (task->window);
+
+  return FALSE;
+}
+
+static void
+wnck_task_drag_leave (GtkWidget          *widget,
+		      GdkDragContext     *context,
+		      guint               time,
+		      WnckTask           *task)
+{
+
+  if (task->button_activate != 0)
+    {
+      gtk_timeout_remove (task->button_activate);
+      task->button_activate = 0;
+    }
+}	
+
+static gboolean
+wnck_task_drag_motion (GtkWidget          *widget,
+		       GdkDragContext     *context,
+		       gint                x,
+		       gint                y,
+		       guint               time,
+		       WnckTask            *task)
+{
+
+  if(task->button_activate == 0 && !(task->is_application))
+    task->button_activate = gtk_timeout_add (TIMEOUT_ACTIVATE, 
+                                             wnck_task_motion_timeout, 
+                                             task);
+
+  gdk_drag_status (context,0,time);
+  
+  return TRUE;
+}
+
+static gboolean
 wnck_task_button_press_event (GtkWidget	      *widget,
 			      GdkEventButton  *event,
 			      gpointer         data)
 {
   WnckTask *task = WNCK_TASK (data);
@@ -1768,18 +1818,23 @@ wnck_task_create_widgets (WnckTask *task
   
   if (!disable_sound_quark)
     disable_sound_quark = g_quark_from_static_string ("gnome_disable_sound_events");
 
   task->button = gtk_toggle_button_new ();
+
+  task->button_activate = 0;
+
   g_object_set_qdata (G_OBJECT (task->button),
 		      disable_sound_quark, GINT_TO_POINTER (TRUE));
   g_object_add_weak_pointer (G_OBJECT (task->button),
                              (void**) &task->button);
   
   gtk_widget_set_name (task->button,
 		       "tasklist-button");
 
+  gtk_drag_dest_set (GTK_WIDGET(task->button), 0, NULL, 0, 0);
+
   table = gtk_table_new (1, 2, FALSE);
 
   pixbuf = wnck_task_get_icon (task);
   if (pixbuf)
     {
@@ -1821,10 +1876,20 @@ wnck_task_create_widgets (WnckTask *task
                            0);
 
   
   g_signal_connect_object (G_OBJECT (task->button), "button_press_event",
                            G_CALLBACK (wnck_task_button_press_event),
+                           G_OBJECT (task),
+                           0);
+
+  g_signal_connect_object (G_OBJECT(task->button), "drag_motion",
+                           G_CALLBACK (wnck_task_drag_motion),
+                           G_OBJECT (task),
+                           0);
+
+  g_signal_connect_object (G_OBJECT(task->button), "drag_leave",
+                           G_CALLBACK (wnck_task_drag_leave),
                            G_OBJECT (task),
                            0);
 
   if (task->is_application)
     {
