--- devilspie-0.17.1/src/actions.c.orig	2006-05-31 14:22:35.000000000 -0600
+++ devilspie-0.17.1/src/actions.c	2006-05-31 16:29:34.000000000 -0600
@@ -165,7 +165,11 @@ ESExpResult *func_center(ESExp *f, int a
   WnckScreen *screen;
   WnckWorkspace *workspace;
   screen           = wnck_window_get_screen (c->window);
-  workspace        = wnck_screen_get_active_workspace (screen);
+  /* wnck_screen_get_active_workspace() may fail;
+     assume that geometry of workspace 0 is good enough */
+  workspace        = wnck_screen_get_workspace (screen, 0);
+  if (workspace == NULL)
+    return e_sexp_result_new_bool (f, FALSE);
   workspace_width  = wnck_workspace_get_width  (workspace);
   workspace_height = wnck_workspace_get_height (workspace);
 
