Index: /trunk/src/VBox/Additions/x11/Installer/98vboxadd-xclient
===================================================================
--- /trunk/src/VBox/Additions/x11/Installer/98vboxadd-xclient	(revision 21921)
+++ /trunk/src/VBox/Additions/x11/Installer/98vboxadd-xclient	(revision 21922)
@@ -19,4 +19,4 @@
 
 /usr/bin/VBoxClient --clipboard
-/usr/bin/VBoxClient --autoresize
+/usr/bin/VBoxClient --display
 /usr/bin/VBoxClient --seamless
Index: /trunk/src/VBox/Additions/x11/VBoxClient/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/Makefile.kmk	(revision 21921)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/Makefile.kmk	(revision 21922)
@@ -58,5 +58,5 @@
 	seamless-x11.cpp \
 	thread.cpp \
-	autoresize.cpp
+	display.cpp
  VBoxClient_LIBS += \
 	Xext Xmu
Index: /trunk/src/VBox/Additions/x11/VBoxClient/VBoxClient.h
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/VBoxClient.h	(revision 21921)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/VBoxClient.h	(revision 21922)
@@ -45,5 +45,5 @@
 extern Service *GetClipboardService();
 extern Service *GetSeamlessService();
-extern Service *GetAutoResizeService();
+extern Service *GetDisplayService();
 
 extern void CleanUp();
Index: unk/src/VBox/Additions/x11/VBoxClient/autoresize.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/autoresize.cpp	(revision 21921)
+++ 	(revision )
@@ -1,150 +1,0 @@
-/* $Id$ */
-/** @file
- * X11 guest client - display auto-resize.
- */
-
-/*
- * Copyright (C) 2006-2007 Sun Microsystems, Inc.
- *
- * This file is part of VirtualBox Open Source Edition (OSE), as
- * available from http://www.virtualbox.org. This file is free software;
- * you can redistribute it and/or modify it under the terms of the GNU
- * General Public License (GPL) as published by the Free Software
- * Foundation, in version 2 as it comes in the "COPYING" file of the
- * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
- * Clara, CA 95054 USA or visit http://www.sun.com if you need
- * additional information or have any questions.
- */
-
-/** @todo this should probably be replaced by something IPRT */
-/* For system() and WEXITSTATUS() */
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <errno.h>
-
-#include <X11/Xlib.h>
-
-#include <iprt/assert.h>
-#include <iprt/err.h>
-#include <iprt/thread.h>
-#include <VBox/log.h>
-#include <VBox/VMMDev.h>
-#include <VBox/VBoxGuestLib.h>
-
-#include "VBoxClient.h"
-
-static int initAutoResize()
-{
-    int rc = VINF_SUCCESS;
-    int rcSystem, rcErrno;
-
-    LogFlowFunc(("\n"));
-    rcSystem = system("VBoxRandR --test");
-    if (-1 == rcSystem)
-    {
-        rcErrno = errno;
-        rc = RTErrConvertFromErrno(rcErrno);
-    }
-    if (RT_SUCCESS(rc))
-    {
-        if (0 != WEXITSTATUS(rcSystem))
-            rc = VERR_NOT_SUPPORTED;
-    }
-    if (RT_SUCCESS(rc))
-        rc = VbglR3CtlFilterMask(  VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST
-                                 | VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED, 0);
-    LogFlowFunc(("returning %Rrc\n", rc));
-    return rc;
-}
-
-void cleanupAutoResize(void)
-{
-    LogFlowFunc(("\n"));
-    VbglR3CtlFilterMask(0,   VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST
-                           | VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED);
-    LogFlowFunc(("returning\n"));
-}
-
-/** This thread just runs a dummy X11 event loop to be sure that we get
- * terminated should the X server exit. */
-static int x11ConnectionMonitor(RTTHREAD, void *)
-{
-    XEvent ev;
-    Display *pDisplay = XOpenDisplay(NULL);
-    while (true)
-        XNextEvent(pDisplay, &ev);
-}
-
-/**
- * Display change request monitor thread function.
- * Before entering the loop, we re-read the last request
- * received, and if the first one received inside the
- * loop is identical we ignore it, because it is probably
- * stale.
- */
-int runAutoResize()
-{
-    LogFlowFunc(("\n"));
-    uint32_t cx0 = 0, cy0 = 0, cBits0 = 0, iDisplay0 = 0;
-    int rc = RTThreadCreate(NULL, x11ConnectionMonitor, NULL, 0,
-                   RTTHREADTYPE_INFREQUENT_POLLER, 0, "X11 monitor");
-    if (RT_FAILURE(rc))
-        return rc;
-    VbglR3GetDisplayChangeRequest(&cx0, &cy0, &cBits0, &iDisplay0, false);
-    while (true)
-    {
-        uint32_t fEvents = 0, cx = 0, cy = 0, cBits = 0, iDisplay = 0;
-        rc = VbglR3WaitEvent(VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST,
-                             RT_INDEFINITE_WAIT, &fEvents);
-        if (RT_SUCCESS(rc) && (fEvents & VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST))
-        {
-            rc = VbglR3GetDisplayChangeRequest(&cx, &cy, &cBits, &iDisplay,
-                                               true);
-            /* Ignore the request if it is stale */
-            if ((cx != cx0) || (cy != cy0) || RT_FAILURE(rc))
-            {
-	            /* If we are not stopping, sleep for a bit to avoid using up
-	                too much CPU while retrying. */
-	            if (RT_FAILURE(rc))
-	                RTThreadYield();
-	            else
-	            {
-	                system("VBoxRandR");
-                    cx0 = cx;
-                    cy0 = cy;
-	            }
-            }
-        }
-    }
-    LogFlowFunc(("returning VINF_SUCCESS\n"));
-    return VINF_SUCCESS;
-}
-
-class AutoResizeService : public VBoxClient::Service
-{
-public:
-    virtual const char *getPidFilePath()
-    {
-        return ".vboxclient-autoresize.pid";
-    }
-    virtual int run()
-    {
-        int rc = initAutoResize();
-        if (RT_SUCCESS(rc))
-            rc = runAutoResize();
-        return rc;
-    }
-    virtual void cleanup()
-    {
-        cleanupAutoResize();
-    }
-};
-
-VBoxClient::Service *VBoxClient::GetAutoResizeService()
-{
-    return new AutoResizeService;
-}
Index: /trunk/src/VBox/Additions/x11/VBoxClient/display.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/display.cpp	(revision 21922)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/display.cpp	(revision 21922)
@@ -0,0 +1,150 @@
+/* $Id$ */
+/** @file
+ * X11 guest client - display management.
+ */
+
+/*
+ * Copyright (C) 2006-2007 Sun Microsystems, Inc.
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+ * Clara, CA 95054 USA or visit http://www.sun.com if you need
+ * additional information or have any questions.
+ */
+
+/** @todo this should probably be replaced by something IPRT */
+/* For system() and WEXITSTATUS() */
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <errno.h>
+
+#include <X11/Xlib.h>
+
+#include <iprt/assert.h>
+#include <iprt/err.h>
+#include <iprt/thread.h>
+#include <VBox/log.h>
+#include <VBox/VMMDev.h>
+#include <VBox/VBoxGuestLib.h>
+
+#include "VBoxClient.h"
+
+static int initDisplay()
+{
+    int rc = VINF_SUCCESS;
+    int rcSystem, rcErrno;
+
+    LogFlowFunc(("\n"));
+    rcSystem = system("VBoxRandR --test");
+    if (-1 == rcSystem)
+    {
+        rcErrno = errno;
+        rc = RTErrConvertFromErrno(rcErrno);
+    }
+    if (RT_SUCCESS(rc))
+    {
+        if (0 != WEXITSTATUS(rcSystem))
+            rc = VERR_NOT_SUPPORTED;
+    }
+    if (RT_SUCCESS(rc))
+        rc = VbglR3CtlFilterMask(  VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST
+                                 | VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED, 0);
+    LogFlowFunc(("returning %Rrc\n", rc));
+    return rc;
+}
+
+void cleanupDisplay(void)
+{
+    LogFlowFunc(("\n"));
+    VbglR3CtlFilterMask(0,   VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST
+                           | VMMDEV_EVENT_MOUSE_CAPABILITIES_CHANGED);
+    LogFlowFunc(("returning\n"));
+}
+
+/** This thread just runs a dummy X11 event loop to be sure that we get
+ * terminated should the X server exit. */
+static int x11ConnectionMonitor(RTTHREAD, void *)
+{
+    XEvent ev;
+    Display *pDisplay = XOpenDisplay(NULL);
+    while (true)
+        XNextEvent(pDisplay, &ev);
+}
+
+/**
+ * Display change request monitor thread function.
+ * Before entering the loop, we re-read the last request
+ * received, and if the first one received inside the
+ * loop is identical we ignore it, because it is probably
+ * stale.
+ */
+int runDisplay()
+{
+    LogFlowFunc(("\n"));
+    uint32_t cx0 = 0, cy0 = 0, cBits0 = 0, iDisplay0 = 0;
+    int rc = RTThreadCreate(NULL, x11ConnectionMonitor, NULL, 0,
+                   RTTHREADTYPE_INFREQUENT_POLLER, 0, "X11 monitor");
+    if (RT_FAILURE(rc))
+        return rc;
+    VbglR3GetDisplayChangeRequest(&cx0, &cy0, &cBits0, &iDisplay0, false);
+    while (true)
+    {
+        uint32_t fEvents = 0, cx = 0, cy = 0, cBits = 0, iDisplay = 0;
+        rc = VbglR3WaitEvent(VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST,
+                             RT_INDEFINITE_WAIT, &fEvents);
+        if (RT_SUCCESS(rc) && (fEvents & VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST))
+        {
+            rc = VbglR3GetDisplayChangeRequest(&cx, &cy, &cBits, &iDisplay,
+                                               true);
+            /* Ignore the request if it is stale */
+            if ((cx != cx0) || (cy != cy0) || RT_FAILURE(rc))
+            {
+	            /* If we are not stopping, sleep for a bit to avoid using up
+	                too much CPU while retrying. */
+	            if (RT_FAILURE(rc))
+	                RTThreadYield();
+	            else
+	            {
+	                system("VBoxRandR");
+                    cx0 = cx;
+                    cy0 = cy;
+	            }
+            }
+        }
+    }
+    LogFlowFunc(("returning VINF_SUCCESS\n"));
+    return VINF_SUCCESS;
+}
+
+class DisplayService : public VBoxClient::Service
+{
+public:
+    virtual const char *getPidFilePath()
+    {
+        return ".vboxclient-display.pid";
+    }
+    virtual int run()
+    {
+        int rc = initDisplay();
+        if (RT_SUCCESS(rc))
+            rc = runDisplay();
+        return rc;
+    }
+    virtual void cleanup()
+    {
+        cleanupDisplay();
+    }
+};
+
+VBoxClient::Service *VBoxClient::GetDisplayService()
+{
+    return new DisplayService;
+}
Index: /trunk/src/VBox/Additions/x11/VBoxClient/main.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/main.cpp	(revision 21921)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/main.cpp	(revision 21922)
@@ -147,9 +147,9 @@
 void vboxClientUsage(const char *pcszFileName)
 {
-    RTPrintf("Usage: %s --clipboard|--autoresize|--seamless [-d|--nodaemon]\n", pcszFileName);
+    RTPrintf("Usage: %s --clipboard|--display|--seamless [-d|--nodaemon]\n", pcszFileName);
     RTPrintf("Start the VirtualBox X Window System guest services.\n\n");
     RTPrintf("Options:\n");
     RTPrintf("  --clipboard      start the shared clipboard service\n");
-    RTPrintf("  --autoresize     start the display auto-resize service\n");
+    RTPrintf("  --display     start the display management service\n");
     RTPrintf("  --seamless       start the seamless windows service\n");
     RTPrintf("  -d, --nodaemon   continue running as a system service\n");
@@ -190,8 +190,8 @@
                 fSuccess = false;
         }
-        else if (!strcmp(argv[i], "--autoresize"))
+        else if (!strcmp(argv[i], "--display"))
         {
             if (g_pService == NULL)
-                g_pService = VBoxClient::GetAutoResizeService();
+                g_pService = VBoxClient::GetDisplayService();
             else
                 fSuccess = false;
