--- metacity-2.16.0/src/window.c.clear-allowed-actions	2006-11-15 18:35:03.000000000 -0500
+++ metacity-2.16.0/src/window.c	2006-11-15 18:51:24.000000000 -0500
@@ -65,6 +65,7 @@
 static void     set_wm_state              (MetaWindow     *window,
                                            int             state);
 static void     set_net_wm_state          (MetaWindow     *window);
+static void     clear_allowed_actions (MetaWindow *window);
 
 static void     send_configure_notify     (MetaWindow     *window);
 static gboolean process_property_notify   (MetaWindow     *window,
@@ -579,6 +580,15 @@
   
   meta_window_reload_properties (window, initial_props, N_INITIAL_PROPS);
   
+  /* FIXME: This is a lame workaround for the fact that metacity
+   * doesn't set _NET_WM_ALLOWED_ACTIONS correctly (bug 115247).
+   *
+   * To prevent taskswitchers etc. from picking up the allowed actions
+   * from whatever a previous window manager set them to, we clear
+   * the property here.
+   */
+  clear_allowed_actions (window);
+  
   update_sm_hints (window); /* must come after transient_for */
   update_role (window);
   update_net_wm_type (window);
@@ -5893,6 +5903,14 @@
 #undef MAX_N_ACTIONS
 }
 
+static void
+clear_allowed_actions (MetaWindow *window)
+{
+  meta_error_trap_push (window->display);
+  XDeleteProperty (window->display->xdisplay, window->xwindow, window->display->atom_net_wm_allowed_actions);
+  meta_error_trap_pop (window->display, FALSE);
+}
+
 void
 meta_window_recalc_features (MetaWindow *window)
 {
