? INSTALL
? depcomp
? install-sh
? missing
? mkinstalldirs
? patch_libwnck
? stamp-h1
Index: libwnck/pager.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/pager.c,v
retrieving revision 1.40
diff -u -r1.40 pager.c
--- libwnck/pager.c	4 Oct 2004 03:51:39 -0000	1.40
+++ libwnck/pager.c	5 Jan 2005 11:24:12 -0000
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 2 -*- */
 /* pager object */
 
 /*
@@ -28,7 +29,7 @@
 #include "xutils.h"
 #include "pager-accessible-factory.h"
 #include "workspace-accessible-factory.h"
-
+#include "private.h"
 
 #define N_SCREEN_CONNECTIONS 11
 
@@ -59,6 +60,9 @@
   GdkPixbuf *bg_cache;
 
   int layout_manager_token;
+
+  guint dnd_activate;
+  gint  dnd_workspace_number;
 };
 
 enum
@@ -88,6 +92,14 @@
                                           GdkEventExpose   *event);
 static gboolean wnck_pager_button_press  (GtkWidget        *widget,
                                           GdkEventButton   *event);
+static gboolean wnck_pager_drag_motion   (GtkWidget        *widget,
+                                          GdkDragContext   *context,
+                                          gint              x,
+                                          gint              y,
+                                          guint             time);
+static void wnck_pager_drag_motion_leave (GtkWidget        *widget,
+                                          GdkDragContext   *context,
+                                          guint             time);
 static gboolean wnck_pager_motion        (GtkWidget        *widget,
                                           GdkEventMotion   *event);
 static gboolean wnck_pager_button_release (GtkWidget        *widget,
@@ -161,6 +173,8 @@
   pager->priv->bg_cache = NULL;
   pager->priv->layout_manager_token = WNCK_NO_MANAGER_TOKEN;
 
+  gtk_drag_dest_set (GTK_WIDGET (pager), 0, NULL, 0, 0);
+
   GTK_WIDGET_SET_FLAGS (GTK_WIDGET (pager), GTK_CAN_FOCUS);
 }
 
@@ -183,7 +197,9 @@
   widget_class->button_release_event = wnck_pager_button_release;
   widget_class->motion_notify_event = wnck_pager_motion;
   widget_class->focus = wnck_pager_focus;
-  widget_class->get_accessible = wnck_pager_get_accessible;   
+  widget_class->get_accessible = wnck_pager_get_accessible;
+  widget_class->drag_leave = wnck_pager_drag_motion_leave;
+  widget_class->drag_motion = wnck_pager_drag_motion;	
 }
 
 static void
@@ -200,7 +216,10 @@
       g_object_unref (G_OBJECT (pager->priv->bg_cache));
       pager->priv->bg_cache = NULL;
     }
-  
+
+  if (pager->priv->dnd_activate != 0)
+    g_source_remove (pager->priv->dnd_activate);
+
   g_free (pager->priv);
   
   G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -594,7 +613,7 @@
   unclipped_win_rect.width = width;
   unclipped_win_rect.height = height;
 
-  gdk_rectangle_intersect (workspace_rect, &unclipped_win_rect, rect);
+  gdk_rectangle_intersect ((GdkRectangle *) workspace_rect, &unclipped_win_rect, rect);
 }
 
 static void
@@ -1088,6 +1107,63 @@
     }
   
   return handled;
+}
+
+static gboolean
+wnck_pager_drag_motion_timeout (gpointer data)
+{
+  WnckPager *pager = WNCK_PAGER (data);
+  WnckWorkspace *active_workspace, *dnd_workspace;
+
+  pager->priv->dnd_activate = 0;
+  active_workspace = wnck_screen_get_active_workspace (pager->priv->screen);
+  dnd_workspace    = wnck_screen_get_workspace (pager->priv->screen,
+                                                pager->priv->dnd_workspace_number);
+
+  if (dnd_workspace &&
+      (pager->priv->dnd_workspace_number != wnck_workspace_get_number (active_workspace)))
+    wnck_workspace_activate (dnd_workspace);
+
+  return FALSE;
+}
+
+static gboolean 
+wnck_pager_drag_motion (GtkWidget          *widget,
+                        GdkDragContext     *context,
+                        gint                x,
+                        gint                y,
+                        guint               time)
+{
+  WnckPager *pager;
+
+  pager = WNCK_PAGER (widget);
+
+  if (pager->priv->dnd_activate == 0 )
+    pager->priv->dnd_activate = g_timeout_add (WNCK_ACTIVATE_TIMEOUT,
+                                               wnck_pager_drag_motion_timeout,
+                                               pager);
+
+  pager->priv->dnd_workspace_number = workspace_at_point (pager, x, y, NULL, NULL);
+  gdk_drag_status (context, 0, time);
+
+  return (pager->priv->dnd_workspace_number != -1);
+}
+ 
+static void
+wnck_pager_drag_motion_leave (GtkWidget          *widget,
+                              GdkDragContext     *context,
+                              guint               time)
+{
+  WnckPager *pager;
+
+  pager = WNCK_PAGER (widget);
+
+  if (pager->priv->dnd_activate != 0)
+    {
+      g_source_remove (pager->priv->dnd_activate);
+      pager->priv->dnd_workspace_number = -1;
+      pager->priv->dnd_activate = 0;
+    }
 }
 
 static gboolean
Index: libwnck/private.h
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/private.h,v
retrieving revision 1.16
diff -u -r1.16 private.h
--- libwnck/private.h	22 Nov 2003 23:49:12 -0000	1.16
+++ libwnck/private.h	5 Jan 2005 11:24:12 -0000
@@ -38,6 +38,8 @@
 
 #define _(x) dgettext (GETTEXT_PACKAGE, x)
 
+#define WNCK_ACTIVATE_TIMEOUT 1000
+
 void _wnck_application_process_property_notify (WnckApplication *app,
                                                 XEvent          *xevent);
 void _wnck_window_process_property_notify (WnckWindow *window,
Index: libwnck/tasklist.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/tasklist.c,v
retrieving revision 1.67
diff -u -r1.67 tasklist.c
--- libwnck/tasklist.c	20 Dec 2004 16:49:35 -0000	1.67
+++ libwnck/tasklist.c	5 Jan 2005 11:24:13 -0000
@@ -62,8 +62,6 @@
 #define DEFAULT_WIDTH 1
 #define DEFAULT_HEIGHT 48
 
-#define TIMEOUT_ACTIVATE 1000
-
 #define N_SCREEN_CONNECTIONS 5
 
 #define POINT_IN_RECT(xcoord, ycoord, rect) \
@@ -2442,7 +2440,7 @@
 {
 
    if (task->button_activate == 0 && task->type == WNCK_TASK_WINDOW)
-       task->button_activate = g_timeout_add (TIMEOUT_ACTIVATE,
+       task->button_activate = g_timeout_add (WNCK_ACTIVATE_TIMEOUT,
                                               wnck_task_motion_timeout,
                                               task);
    gdk_drag_status (context,0,time);
