--- contextual.module	2011-01-09 23:52:00.000000000 +0100
+++ contextual.module2	2011-01-31 17:00:00.000000000 +0100
@@ -231,6 +231,7 @@ function contextual_preprocess_views_vie
         'weight' => 1,
         'title' => 'Edit term',
         'href' => 'admin/content/taxonomy/edit/term/'. $term->tid,
+        'query' => drupal_get_destination(),
       );
       contextual_set_links('page-actions', $links['term-edit'], 'term-edit');
     }
@@ -254,11 +255,13 @@ function contextual_contextual_page($pag
       'weight' => 1,
       'title' => 'Edit contact',
       'href' => 'admin/build/contact',
+      'query' => drupal_get_destination(),
     );
     $links['contact-edit-settings'] = array(
       'weight' => 1,
       'title' => 'Edit contact description',
       'href' => 'admin/build/contact/settings',
+      'query' => drupal_get_destination(),
     );
     contextual_set_links('page-actions', $links);
   }
@@ -276,12 +279,14 @@ function contextual_contextual_block($bl
       'weight' => 2,
       'title' => 'Manage blocks',
       'href' => 'admin/build/block',
+      'query' => drupal_get_destination(),
     );
 
     $links['block-configure'] = array(
       'weight' => 1,
       'title' => 'Configure block',
       'href' => 'admin/build/block/configure/'. $block->module .'/'. $block->delta,
+      'query' => drupal_get_destination(),
     );
   }
 
@@ -295,6 +300,7 @@ function contextual_contextual_block($bl
         'weight' => 2,
         'title' => 'Configure menu',
         'href' => 'admin/build/menu-customize/'. $menu_name,
+        'query' => drupal_get_destination(),
       );
     }
 
@@ -306,6 +312,7 @@ function contextual_contextual_block($bl
         'weight' => 0,
         'title' => 'Configure menu',
         'href' => 'admin/build/menu-customize/'. $menu_name,
+        'query' => drupal_get_destination(),
       );
     }
   }
@@ -333,6 +340,7 @@ function contextual_contextual_node($nod
     'weight' => ++$weight,
     'title' => 'Edit',
     'href' => 'node/' . $node->nid . '/edit',
+    'query' => drupal_get_destination(),
     'access callback' => 'node_access',
     'access arguments' => array('update', $node)
   );
@@ -343,6 +351,7 @@ function contextual_contextual_node($nod
       'weight' => ++$weight,
       'title' => 'Translate',
       'href' => 'node/' . $node->nid . '/translate',
+      'query' => drupal_get_destination(),
       'access callback' => '_translation_tab_access',
       'access arguments' => array($node)
     );
@@ -352,6 +361,7 @@ function contextual_contextual_node($nod
     'weight' => ++$weight,
     'title' => 'Delete',
     'href' => 'node/' . $node->nid . '/delete',
+    'query' => drupal_get_destination(),
     'access callback' => 'node_access',
     'access arguments' => array('delete', $node)
   );
@@ -360,6 +370,7 @@ function contextual_contextual_node($nod
     'weight' => ++$weight,
     'title' => 'Revisions',
     'href' => 'node/' . $node->nid . '/revisions',
+    'query' => drupal_get_destination(),
     'access callback' => '_node_revision_access',
     'access arguments' => array($node)
   );
@@ -370,6 +381,7 @@ function contextual_contextual_node($nod
       'weight' => ++$weight,
       'title' => 'Webform fields',
       'href' => 'node/'.$node->nid.'/edit/components',
+      'query' => drupal_get_destination(),
       'access callback' => 'node_access',
       'access arguments' => array('update', $node),
     );
@@ -421,6 +433,7 @@ function contextual_contextual_user($acc
       'weight' => 0,
       'title' => 'Edit user',
       'href' => 'user/'. $account->uid .'/edit/',
+      'query' => drupal_get_destination(),
     );
     contextual_set_links('page-actions', $links);
   }
@@ -437,18 +450,21 @@ function contextual_contextual_views($vi
     'weight' => 0,
     'title' => 'Edit view',
     'href' => 'admin/build/views/edit/' . $view->name,
+    'query' => drupal_get_destination(),
     'fragment' => 'views-tab-' . $view->current_display
   );
   $links['views-export'] = array(
     'weight' => 1,
     'title' => 'Export view',
     'href' => 'admin/build/views/export/' . $view->name,
+    'query' => drupal_get_destination(),
     'fragment' => 'views-tab-' . $view->current_display
   );
   $links['views-clone'] = array(
     'weight' => 2,
     'title' => 'Clone view',
     'href' => 'admin/build/views/clone/' . $view->name,
+    'query' => drupal_get_destination(),
     'fragment' => 'views-tab-' . $view->current_display
   );
 
