Index: src/include/prefs.h
===================================================================
--- src/include/prefs.h	(revision 3523)
+++ src/include/prefs.h	(working copy)
@@ -34,7 +34,7 @@
   META_PREF_MOUSE_BUTTON_MODS,
   META_PREF_FOCUS_MODE,
   META_PREF_FOCUS_NEW_WINDOWS,
-  META_PREF_RAISE_ON_CLICK,
+  META_PREF_RAISE_POLICY,
   META_PREF_ACTION_DOUBLE_CLICK_TITLEBAR,
   META_PREF_ACTION_MIDDLE_CLICK_TITLEBAR,
   META_PREF_ACTION_RIGHT_CLICK_TITLEBAR,
@@ -75,7 +75,8 @@
 MetaVirtualModifier         meta_prefs_get_mouse_button_mods  (void);
 MetaFocusMode               meta_prefs_get_focus_mode         (void);
 MetaFocusNewWindows         meta_prefs_get_focus_new_windows  (void);
-gboolean                    meta_prefs_get_raise_on_click     (void);
+MetaRaisePolicy             meta_prefs_get_raise_policy       (void);
+gboolean                    meta_prefs_get_never_raise        (void);
 const char*                 meta_prefs_get_theme              (void);
 /* returns NULL if GTK default should be used */
 const PangoFontDescription* meta_prefs_get_titlebar_font      (void);
Index: src/include/common.h
===================================================================
--- src/include/common.h	(revision 3523)
+++ src/include/common.h	(working copy)
@@ -256,6 +256,21 @@
   META_BUTTON_FUNCTION_LAST
 } MetaButtonFunction;
 
+/* Interaction between raising and other operations */
+typedef enum
+{
+  /* Active window should always be raised (default) */
+  META_RAISE_POLICY_ALWAYS,
+  /* Allow user to click in client area or drag frame (move/resize) without
+   * raising
+   */
+  META_RAISE_POLICY_UNIX,
+  /* Never raise active window except when user clicks frame, as per previous
+   * raise_on_click == 0
+   */
+  META_RAISE_POLICY_DECOUPLED
+} MetaRaisePolicy;
+
 #define MAX_BUTTONS_PER_CORNER META_BUTTON_FUNCTION_LAST
 
 typedef struct _MetaButtonLayout MetaButtonLayout;
Index: src/core/display.c
===================================================================
--- src/core/display.c	(revision 3523)
+++ src/core/display.c	(working copy)
@@ -1804,7 +1804,8 @@
                */
               if (!frame_was_receiver)
                 {
-                  if (meta_prefs_get_raise_on_click ()) 
+                  if (meta_prefs_get_raise_policy () ==
+                      META_RAISE_POLICY_ALWAYS) 
                     meta_window_raise (window);
                   else
                     meta_topic (META_DEBUG_FOCUS,
@@ -1884,7 +1885,7 @@
             }
           else if (event->xbutton.button == 3)
             {
-              if (meta_prefs_get_raise_on_click ())
+              if (meta_prefs_get_raise_policy () == META_RAISE_POLICY_ALWAYS)
                 meta_window_raise (window);
               meta_window_show_menu (window,
                                      event->xbutton.x_root,
@@ -3429,7 +3430,7 @@
   if (window &&
       (meta_grab_op_is_moving (op) || meta_grab_op_is_resizing (op)))
     {
-      if (meta_prefs_get_raise_on_click ())
+      if (meta_prefs_get_raise_policy () == META_RAISE_POLICY_ALWAYS)
         meta_window_raise (window);
       else
         {
@@ -3679,7 +3680,7 @@
     display->grab_window->shaken_loose = FALSE;
   
   if (display->grab_window != NULL &&
-      !meta_prefs_get_raise_on_click () &&
+      meta_prefs_get_raise_policy () != META_RAISE_POLICY_ALWAYS &&
       (meta_grab_op_is_moving (display->grab_op) ||
        meta_grab_op_is_resizing (display->grab_op)))
     {
@@ -3804,7 +3805,7 @@
                                       int          y)
 {
   /* Don't bother doing the check again if we've already reached the threshold */
-  if (meta_prefs_get_raise_on_click () ||
+  if (meta_prefs_get_raise_policy () == META_RAISE_POLICY_ALWAYS ||
       display->grab_threshold_movement_reached)
     return;
 
Index: src/core/core.c
===================================================================
--- src/core/core.c	(revision 3523)
+++ src/core/core.c	(working copy)
@@ -263,7 +263,7 @@
   meta_window_lower (window);
 
   if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK &&
-      meta_prefs_get_raise_on_click ())
+      meta_prefs_get_raise_policy () == META_RAISE_POLICY_ALWAYS)
     {
       /* Move window to the back of the focusing workspace's MRU list.
        * Do extra sanity checks to avoid possible race conditions.
@@ -321,7 +321,7 @@
 {
   MetaWindow *window = get_window (xdisplay, frame_xwindow);
 
-  if (meta_prefs_get_raise_on_click ())
+  if (meta_prefs_get_raise_policy () == META_RAISE_POLICY_ALWAYS)
     meta_window_raise (window);
 
   meta_window_maximize (window, 
@@ -334,7 +334,7 @@
 {
   MetaWindow *window = get_window (xdisplay, frame_xwindow);
 
-  if (meta_prefs_get_raise_on_click ())
+  if (meta_prefs_get_raise_policy () == META_RAISE_POLICY_ALWAYS)
     meta_window_raise (window);
 
   if (META_WINDOW_MAXIMIZED (window))
@@ -351,7 +351,7 @@
 {
   MetaWindow *window = get_window (xdisplay, frame_xwindow);
 
-  if (meta_prefs_get_raise_on_click ())
+  if (meta_prefs_get_raise_policy () == META_RAISE_POLICY_ALWAYS)
     meta_window_raise (window);
 
   meta_window_unmaximize (window,
@@ -466,7 +466,7 @@
 {
   MetaWindow *window = get_window (xdisplay, frame_xwindow);
   
-  if (meta_prefs_get_raise_on_click ())
+  if (meta_prefs_get_raise_policy () == META_RAISE_POLICY_ALWAYS)
     meta_window_raise (window);
   meta_window_focus (window, timestamp);
 
Index: src/core/window.c
===================================================================
--- src/core/window.c	(revision 3523)
+++ src/core/window.c	(working copy)
@@ -2154,7 +2154,7 @@
        */
       if (overlap || 
           (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK &&
-           meta_prefs_get_raise_on_click ()))
+           meta_prefs_get_raise_policy () == META_RAISE_POLICY_ALWAYS))
         meta_window_stack_just_below (window, focus_window);
 
       /* If the window will be obscured by the focus window, then the
@@ -2890,7 +2890,7 @@
 
   unminimize_window_and_all_transient_parents (window);
 
-  if (meta_prefs_get_raise_on_click () ||
+  if (meta_prefs_get_raise_policy () != META_RAISE_POLICY_DECOUPLED ||
       source_indication == META_CLIENT_TYPE_PAGER)
     meta_window_raise (window);
 
@@ -4618,7 +4618,7 @@
       MetaWindow *active_window;
       active_window = window->display->expected_focus_window;
       if (meta_prefs_get_disable_workarounds () ||
-          !meta_prefs_get_raise_on_click ())
+          meta_prefs_get_raise_policy () != META_RAISE_POLICY_ALWAYS)
         {
           meta_topic (META_DEBUG_STACK,
                       "%s sent an xconfigure stacking request; this is "
@@ -4822,13 +4822,13 @@
                   !window->maximized_horizontally));
           if (max && window->has_maximize_func)
             {
-              if (meta_prefs_get_raise_on_click ())
+              if (meta_prefs_get_raise_policy () == META_RAISE_POLICY_ALWAYS)
                 meta_window_raise (window);
               meta_window_maximize (window, META_MAXIMIZE_HORIZONTAL);
             }
           else
             {
-              if (meta_prefs_get_raise_on_click ())
+              if (meta_prefs_get_raise_policy () == META_RAISE_POLICY_ALWAYS)
                 meta_window_raise (window);
               meta_window_unmaximize (window, META_MAXIMIZE_HORIZONTAL);
             }
@@ -4844,13 +4844,13 @@
                   !window->maximized_vertically));
           if (max && window->has_maximize_func)
             {
-              if (meta_prefs_get_raise_on_click ())
+              if (meta_prefs_get_raise_policy () == META_RAISE_POLICY_ALWAYS)
                 meta_window_raise (window);
               meta_window_maximize (window, META_MAXIMIZE_VERTICAL);
             }
           else
             {
-              if (meta_prefs_get_raise_on_click ())
+              if (meta_prefs_get_raise_policy () == META_RAISE_POLICY_ALWAYS)
                 meta_window_raise (window);
               meta_window_unmaximize (window, META_MAXIMIZE_VERTICAL);
             }
@@ -5121,6 +5121,14 @@
   return FALSE;
 }
 
+static gboolean
+grab_due_to_prefs (void)
+{
+  return (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK &&
+          meta_prefs_get_raise_policy () == META_RAISE_POLICY_ALWAYS) ||
+         meta_prefs_get_raise_policy () != META_RAISE_POLICY_ALWAYS;
+}
+
 gboolean
 meta_window_notify_focus (MetaWindow *window,
                           XEvent     *event)
@@ -5252,8 +5260,7 @@
            *
            * There is dicussion in bugs 102209, 115072, and 461577
            */
-          if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK ||
-              !meta_prefs_get_raise_on_click())
+          if (grab_due_to_prefs ())
             meta_display_ungrab_focus_window_button (window->display, window);
         }
     }
@@ -5293,8 +5300,7 @@
           meta_window_update_layer (window);
 
           /* Re-grab for click to focus and raise-on-click, if necessary */
-          if (meta_prefs_get_focus_mode () == META_FOCUS_MODE_CLICK ||
-              !meta_prefs_get_raise_on_click ())
+          if (grab_due_to_prefs ())
             meta_display_grab_focus_window_button (window->display, window);
        }
     }
Index: src/core/prefs.c
===================================================================
--- src/core/prefs.c	(revision 3523)
+++ src/core/prefs.c	(working copy)
@@ -45,7 +45,7 @@
 #define KEY_MOUSE_BUTTON_MODS "/apps/metacity/general/mouse_button_modifier"
 #define KEY_FOCUS_MODE "/apps/metacity/general/focus_mode"
 #define KEY_FOCUS_NEW_WINDOWS "/apps/metacity/general/focus_new_windows"
-#define KEY_RAISE_ON_CLICK "/apps/metacity/general/raise_on_click"
+#define KEY_RAISE_POLICY "/apps/metacity/general/raise_policy"
 #define KEY_ACTION_DOUBLE_CLICK_TITLEBAR "/apps/metacity/general/action_double_click_titlebar"
 #define KEY_ACTION_MIDDLE_CLICK_TITLEBAR "/apps/metacity/general/action_middle_click_titlebar"
 #define KEY_ACTION_RIGHT_CLICK_TITLEBAR "/apps/metacity/general/action_right_click_titlebar"
@@ -90,7 +90,7 @@
 static MetaVirtualModifier mouse_button_mods = Mod1Mask;
 static MetaFocusMode focus_mode = META_FOCUS_MODE_CLICK;
 static MetaFocusNewWindows focus_new_windows = META_FOCUS_NEW_WINDOWS_SMART;
-static gboolean raise_on_click = TRUE;
+static MetaRaisePolicy raise_policy = META_RAISE_POLICY_ALWAYS;
 static char* current_theme = NULL;
 static int num_workspaces = 4;
 static MetaActionTitlebar action_double_click_titlebar = META_ACTION_TITLEBAR_TOGGLE_MAXIMIZE;
@@ -124,7 +124,7 @@
 static gboolean update_mouse_button_mods  (const char *value);
 static gboolean update_focus_mode         (const char *value);
 static gboolean update_focus_new_windows  (const char *value);
-static gboolean update_raise_on_click     (gboolean    value);
+static gboolean update_raise_policy       (const char *value);
 static gboolean update_theme              (const char *value);
 static gboolean update_visual_bell        (gboolean v1, gboolean v2);
 static gboolean update_visual_bell_type   (const char *value);
@@ -413,8 +413,11 @@
   update_focus_new_windows (str_val);
   g_free (str_val);  
 
-  if (get_bool (KEY_RAISE_ON_CLICK, &bool_val))
-    update_raise_on_click (bool_val);
+  str_val = gconf_client_get_string (default_client, KEY_RAISE_POLICY,
+                                     &err);
+  cleanup_error (&err);
+  update_raise_policy (str_val);
+  g_free (str_val);  
   
   init_action_meta_prefs (KEY_ACTION_DOUBLE_CLICK_TITLEBAR, &action_double_click_titlebar);
   init_action_meta_prefs (KEY_ACTION_MIDDLE_CLICK_TITLEBAR, &action_middle_click_titlebar);
@@ -639,21 +642,21 @@
       if (update_focus_new_windows (str))
         queue_changed (META_PREF_FOCUS_NEW_WINDOWS);
     }
-  else if (strcmp (key, KEY_RAISE_ON_CLICK) == 0)
+  else if (strcmp (key, KEY_RAISE_POLICY) == 0)
     {
-      gboolean b;
+      const char *str;
 
-      if (value && value->type != GCONF_VALUE_BOOL)
+      if (value && value->type != GCONF_VALUE_STRING)
         {
           meta_warning (_("GConf key \"%s\" is set to an invalid type\n"),
-                        KEY_RAISE_ON_CLICK);
+                        KEY_RAISE_POLICY);
           goto out;
         }
 
-      b = value ? gconf_value_get_bool (value) : TRUE;
+      str = value ? gconf_value_get_string (value) : NULL;
       
-      if (update_raise_on_click (b))
-        queue_changed (META_PREF_RAISE_ON_CLICK);
+      if (update_raise_policy (str))
+        queue_changed (META_PREF_RAISE_POLICY);
     }
   else if (strcmp (key, KEY_THEME) == 0)
     {
@@ -1155,13 +1158,24 @@
 
 #ifdef HAVE_GCONF
 static gboolean
-update_raise_on_click (gboolean value)
+update_raise_policy (const char *value)
 {
-  gboolean old = raise_on_click;
+  MetaRaisePolicy old_policy = raise_policy;
 
-  raise_on_click = value;
+  if (value != NULL)
+    {
+      if (g_ascii_strcasecmp (value, "always") == 0)
+        raise_policy = META_RAISE_POLICY_ALWAYS;
+      else if (g_ascii_strcasecmp (value, "unix") == 0)
+        raise_policy = META_RAISE_POLICY_UNIX;
+      else if (g_ascii_strcasecmp (value, "decoupled") == 0)
+        raise_policy = META_RAISE_POLICY_DECOUPLED;
+      else
+        meta_warning (_("GConf key '%s' is set to an invalid value\n"),
+                      KEY_RAISE_POLICY);
+    }
 
-  return old != value;
+  return (old_policy != raise_policy);
 }
 #endif /* HAVE_GCONF */
 
@@ -1217,13 +1231,10 @@
   return focus_new_windows;
 }
 
-gboolean
-meta_prefs_get_raise_on_click (void)
+MetaRaisePolicy
+meta_prefs_get_raise_policy (void)
 {
-  /* Force raise_on_click on for click-to-focus, as requested by Havoc
-   * in #326156.
-   */
-  return raise_on_click || focus_mode == META_FOCUS_MODE_CLICK;
+  return raise_policy;
 }
 
 const char*
@@ -1776,8 +1787,8 @@
     case META_PREF_FOCUS_NEW_WINDOWS:
       return "FOCUS_NEW_WINDOWS";
 
-    case META_PREF_RAISE_ON_CLICK:
-      return "RAISE_ON_CLICK";
+    case META_PREF_RAISE_POLICY:
+      return "RAISE_POLICY";
       
     case META_PREF_THEME:
       return "THEME";
Index: src/metacity.schemas.in
===================================================================
--- src/metacity.schemas.in	(revision 3523)
+++ src/metacity.schemas.in	(working copy)
@@ -84,20 +84,22 @@
     </schema>
 
     <schema>
-      <key>/schemas/apps/metacity/general/raise_on_click</key>
-      <applyto>/apps/metacity/general/raise_on_click</applyto>
+      <key>/schemas/apps/metacity/general/raise_policy</key>
+      <applyto>/apps/metacity/general/raise_policy</applyto>
       <owner>metacity</owner>
-      <type>bool</type>
-      <default>true</default>
+      <type>string</type>
+      <default>always</default>
       <locale name="C">
-         <short>Whether raising should be a side-effect of other user
-                interactions</short>
+         <short>Control raising as a side-effect of other user interactions
+		 </short>
          <long>
-           Many actions (e.g. clicking in the client area, moving or resizing the window)
-           normally raise the window as a side-effect. Setting this option to false, which
-           is strongly discouraged, will decouple raising from other user actions, and
-           ignore raise requests generated by applications. See
-           http://bugzilla.gnome.org/show_bug.cgi?id=445447#c6.
+		   Many actions (e.g. clicking in the client area, moving or resizing
+		   the window) normally raise the window as a side-effect. This is the
+		   default behaviour, selected with "always". Setting this option to
+		   "unix" allows the client area to be clicked, or the frame to be
+		   dragged, without raising. The value of "decoupled", which is
+		   strongly discouraged, will entirely decouple raising from other user
+		   actions, and ignore raise requests generated by applications.
          </long>
       </locale>
     </schema>
