Index: libwnck/ChangeLog
===================================================================
RCS file: /export/cvs/gnome-2.0/libwnck/ChangeLog,v
retrieving revision 1.29
diff -p -u -5 -r1.29 ChangeLog
--- libwnck/ChangeLog	2002/08/06 00:00:23	1.29
+++ libwnck/ChangeLog	2002/08/06 16:28:22
@@ -1,5 +1,15 @@
+2002-08-06  Arvind Samptur <arvind.samptur@wipro.com>
+	* libwnck/tasklist.c:
+	(wnck_active_window_timeout):  minimize or restore on a single
+	click only.
+	(wnck_task_button_release_event): activate timer to detect the 
+	double click.
+	(wnck_task_button_press_event): detect the left click and if the
+	current task window is a active one.
+	Fixes #79500
+
 2002-08-02  Mark McLoughlin  <mark@skynet.ie>
 
 	* libwnck/pager.c:
 	(wnck_pager_realize): use wnck_pager_set_layout_hint.
 	(wnck_pager_set_layout_hint): impl, taking into
Index: libwnck/libwnck/tasklist.c
===================================================================
RCS file: /export/cvs/gnome-2.0/libwnck/libwnck/tasklist.c,v
retrieving revision 1.11
diff -p -u -5 -r1.11 tasklist.c
--- libwnck/libwnck/tasklist.c	2002/08/02 23:34:27	1.11
+++ libwnck/libwnck/tasklist.c	2002/08/06 16:28:23
@@ -55,10 +55,12 @@ typedef struct _WnckTaskClass   WnckTask
 #define DEFAULT_GROUPING_LIMIT 80
 
 #define DEFAULT_WIDTH 1
 #define DEFAULT_HEIGHT 48
 
+#define ACTIVATE_TIMEOUT 150
+
 struct _WnckTask
 {
   GObject parent_instance;
 
   WnckTasklist *tasklist;
@@ -84,10 +86,13 @@ struct _WnckTask
 
   /* task menu */
   GtkWidget *menu;
   /* ops menu */
   GtkWidget *action_menu;
+  
+  guint active_timeout;
+  gboolean was_active;
 };
 
 struct _WnckTaskClass
 {
   GObjectClass parent_class;
@@ -222,10 +227,11 @@ wnck_task_get_type (void)
 }
 
 static void
 wnck_task_init (WnckTask *task)
 {  
+  task->active_timeout = 0;
 }
 
 static void
 wnck_task_class_init (WnckTaskClass *klass)
 {
@@ -1440,12 +1446,13 @@ wnck_tasklist_activate_task_window     (
 	  
       wnck_window_activate (task->window);
     }
   else
     {
-      if (wnck_window_is_active (task->window))
+      if (task->was_active)
 	{
+          task->was_active = FALSE;
 	  wnck_window_minimize (task->window);
 	  return;
 	}
       else
 	{
@@ -1566,12 +1573,10 @@ wnck_task_button_toggled (GtkButton *but
   else
     {
       if (task->window == NULL)
 	return;
 
-      wnck_tasklist_activate_task_window (task);
-
       state = wnck_window_get_state (task->window);
     }
   
 }
 
@@ -1787,10 +1792,41 @@ wnck_task_app_name_changed (WnckApplicat
   if (task)
     wnck_task_update_visible_state (task);
 }
 
 static gboolean
+wnck_active_window_timeout (gpointer data)
+{
+  WnckTask *task = WNCK_TASK (data);
+
+  wnck_tasklist_activate_task_window (task);
+
+  task->active_timeout = 0;
+
+  return FALSE;  
+}
+
+static gboolean
+wnck_task_button_release_event (GtkWidget     *widget,
+			        GdkEventButton  *event,
+			        gpointer         data)
+{
+  WnckTask *task = WNCK_TASK (data);
+
+  if (event->button == 1)
+    {
+      if (task->active_timeout != 0)
+         g_source_remove (task->active_timeout);
+
+      task->active_timeout = g_timeout_add (ACTIVATE_TIMEOUT, wnck_active_window_timeout, task);
+     
+    }
+  
+  return FALSE;
+}
+
+static gboolean
 wnck_task_button_press_event (GtkWidget	      *widget,
 			      GdkEventButton  *event,
 			      gpointer         data)
 {
   WnckTask *task = WNCK_TASK (data);
@@ -1822,10 +1858,17 @@ wnck_task_button_press_event (GtkWidget	
 
       /* FIXME we should really arrange to destroy the menu on popdown */
       
       return TRUE;
     }
+  else if (event->button == 1)
+    {
+       if (wnck_window_is_active(task->window))
+          task->was_active = TRUE;
+       else
+          task->was_active = FALSE;
+    }
   
   return FALSE;
 }
 
 
@@ -1892,10 +1935,15 @@ 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), "button_release_event",
+                           G_CALLBACK (wnck_task_button_release_event),
                            G_OBJECT (task),
                            0);
 
   if (task->is_application)
     {
