Index: window.c
===================================================================
RCS file: /cvs/gnome/metacity/src/window.c,v
retrieving revision 1.422
diff -u -p -r1.422 window.c
--- window.c	3 Mar 2006 15:53:10 -0000	1.422
+++ window.c	4 Mar 2006 01:50:53 -0000
@@ -2005,7 +2005,7 @@ meta_window_show (MetaWindow *window)
                * demands attention hint.
                */
               if (overlap)
-                window->wm_state_demands_attention = TRUE;
+                meta_window_set_demands_attention(window);
             }
 
           /* Prevent EnterNotify events in sloppy/mouse focus from
@@ -2487,8 +2487,7 @@ window_activate (MetaWindow     *window,
                   "last_user_time (%lu) is more recent; ignoring "
                   " _NET_ACTIVE_WINDOW message.\n",
                   window->display->last_user_time);
-      window->wm_state_demands_attention = TRUE;
-      set_net_wm_state (window);
+      meta_window_set_demands_attention(window);
       return;
     }
 
@@ -3761,10 +3760,7 @@ meta_window_focus (MetaWindow  *window,
     }
 
   if (window->wm_state_demands_attention)
-    {
-      window->wm_state_demands_attention = FALSE;
-      set_net_wm_state (window);
-    }  
+    meta_window_unset_demands_attention(window);
 }
 
 static void
@@ -4284,10 +4280,7 @@ meta_window_configure_request (MetaWindo
                       active_window->desc,
                       active_window->net_wm_user_time);
           if (event->xconfigurerequest.detail == Above)
-            {
-              window->wm_state_demands_attention = TRUE;
-              set_net_wm_state (window);
-            }
+            meta_window_set_demands_attention(window);
         }
       else
         {
@@ -4533,11 +4526,11 @@ meta_window_client_message (MetaWindow *
       if (first == display->atom_net_wm_state_demands_attention ||
           second == display->atom_net_wm_state_demands_attention)
         {
-          window->wm_state_demands_attention = 
-            (action == _NET_WM_STATE_ADD) ||
-            (action == _NET_WM_STATE_TOGGLE && !window->wm_state_demands_attention);
-
-          set_net_wm_state (window);
+          if ((action == _NET_WM_STATE_ADD) ||
+              (action == _NET_WM_STATE_TOGGLE && !window->wm_state_demands_attention))
+            meta_window_set_demands_attention(window);
+          else
+            meta_window_unset_demands_attention(window);
         }
       
       return TRUE;
@@ -7902,3 +7895,25 @@ meta_window_set_user_time (MetaWindow *w
         window->display->allow_terminal_deactivation = FALSE;
     }
 }
+
+void
+meta_window_set_demands_attention (MetaWindow *window)
+{
+  meta_topic (META_DEBUG_WINDOW_OPS,
+      "Marking %s as needing attention\n", window->desc);
+  
+  window->wm_state_demands_attention = TRUE;
+  set_net_wm_state (window);
+}
+
+void
+meta_window_unset_demands_attention (MetaWindow *window)
+{
+  meta_topic (META_DEBUG_WINDOW_OPS,
+      "Marking %s as not needing attention\n", window->desc);
+  
+  window->wm_state_demands_attention = FALSE;
+  set_net_wm_state (window);
+}
+
+
Index: window.h
===================================================================
RCS file: /cvs/gnome/metacity/src/window.h,v
retrieving revision 1.123
diff -u -p -r1.123 window.h
--- window.h	10 Jan 2006 19:43:21 -0000	1.123
+++ window.h	4 Mar 2006 01:50:53 -0000
@@ -578,4 +578,7 @@ void meta_window_stack_just_below (MetaW
 void meta_window_set_user_time (MetaWindow *window,
                                 Time        timestamp);
 
+void meta_window_set_demands_attention (MetaWindow *window);
+
+void meta_window_unset_demands_attention (MetaWindow *window);
 #endif
