Index: unk/src/VBox/Additions/x11/VBoxClient/seamless-glue.h
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/seamless-glue.h	(revision 50323)
+++ 	(revision )
@@ -1,29 +1,0 @@
-/** @file
- *
- * Guest client: seamless mode
- * Proxy between the guest and host components
- */
-
-/*
- * Copyright (C) 2006-2010 Oracle Corporation
- *
- * 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.
- */
-
-#ifndef __Additions_client_seamless_glue_h
-# define __Additions_client_seamless_glue_h
-
-class VBoxGuestSeamlessObserver
-{
-public:
-    virtual void notify(void) = 0;
-    virtual ~VBoxGuestSeamlessObserver() {}
-};
-
-#endif /* __Additions_client_seamless_glue_h not defined */
Index: unk/src/VBox/Additions/x11/VBoxClient/seamless-guest.h
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/seamless-guest.h	(revision 50323)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/** @file
- *
- * Guest client: seamless mode
- * Abstract class for interacting with the guest system
- */
-
-/*
- * Copyright (C) 2006-2011 Oracle Corporation
- *
- * 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.
- */
-
-#ifndef __Additions_client_seamless_guest_h
-# define __Additions_client_seamless_guest_h
-
-#include <iprt/types.h>      /* for RTRECT */
-
-#include "seamless-glue.h"
-
-/**
- * Observable to monitor the state of the guest windows.  This abstract class definition
- * serves as a template (in the linguistic sense, not the C++ sense) for creating
- * platform-specific child classes.
- */
-class VBoxGuestSeamlessGuest
-{
-public:
-    /** Events which can be reported by this class */
-    enum meEvent
-    {
-        /** Empty event */
-        NONE,
-        /** Seamless mode is now supported */
-        CAPABLE,
-        /** Seamless mode is no longer supported */
-        INCAPABLE
-    };
-};
-
-#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || defined(RT_OS_FREEBSD)
-# include "seamless-x11.h"  /* for VBoxGuestSeamlessGuestImpl */
-#else
-# error Port me
-#endif
-
-#endif /* __Additions_client_seamless_guest_h not defined */
Index: /trunk/src/VBox/Additions/x11/VBoxClient/seamless-host.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/seamless-host.cpp	(revision 50323)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/seamless-host.cpp	(revision 50324)
@@ -106,5 +106,5 @@
 #endif
                 mState = ENABLE;
-                mObserver->notify();
+                mX11MonitorThread->start();
                 break;
             case VMMDev_Seamless_Host_Window:
@@ -120,5 +120,5 @@
 #endif
                 mState = DISABLE;
-                mObserver->notify();
+                mX11MonitorThread->stop(RT_INDEFINITE_WAIT, 0);
         }
     }
@@ -134,5 +134,5 @@
  * Update the set of visible rectangles in the host.
  */
-void VBoxGuestSeamlessHost::updateRects(RTRECT *pRects, size_t cRects)
+void VBoxGuestSeamlessHost::notify(RTRECT *pRects, size_t cRects)
 {
     LogRelFlowFunc(("\n"));
Index: /trunk/src/VBox/Additions/x11/VBoxClient/seamless-host.h
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/seamless-host.h	(revision 50323)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/seamless-host.h	(revision 50324)
@@ -22,5 +22,4 @@
 #include <VBox/VBoxGuestLib.h>      /* for the R3 guest library functions  */
 
-#include "seamless-glue.h"          /* for VBoxGuestSeamlessObserver */
 #include "thread.h"                 /* for VBoxGuestThread */
 
@@ -64,7 +63,18 @@
 
 /**
+ * Small virtual class which provides the interface for notifying the host of
+ * changes to the X11 window configuration, mainly split out from
+ * @a VBoxGuestSeamlessHost to simplify the unit test.
+ */
+class VBoxGuestSeamlessHostInt
+{
+public:
+    virtual void notify(RTRECT *pRects, size_t cRects) = 0;
+};
+
+/**
  * Interface to the host
  */
-class VBoxGuestSeamlessHost
+class VBoxGuestSeamlessHost : public VBoxGuestSeamlessHostInt
 {
     friend class VBoxGuestSeamlessHostThread;
@@ -86,6 +96,7 @@
     VBoxGuestSeamlessHost& operator=(const VBoxGuestSeamlessHost&);
 
-    /** Observer to connect guest and host and ferry events back and forth. */
-    VBoxGuestSeamlessObserver *mObserver;
+    /** Thread to start and stop when we enter and leave seamless mode which
+     *  monitors X11 windows in the guest. */
+    VBoxGuestThread *mX11MonitorThread;
     /** Host seamless event (i.e. enter and leave) thread function. */
     VBoxGuestSeamlessHostThread mThreadFunction;
@@ -113,17 +124,17 @@
     /**
      * Initialise the guest and ensure that it is capable of handling seamless mode
-     * @param   pObserver Observer class to connect host and guest interfaces
+     * @param   pX11MonitorThread Thread class to monitor guest windows.
      *
      * @returns iprt status code
      */
-    int init(VBoxGuestSeamlessObserver *pObserver)
+    int init(VBoxGuestThread *pX11MonitorThread)
     {
         LogRelFlowFunc(("\n"));
-        if (mObserver != 0)  /* Assertion */
+        if (mX11MonitorThread != 0)  /* Assertion */
         {
             LogRel(("VBoxClient: ERROR: attempt to initialise seamless host object twice!\n"));
             return VERR_INTERNAL_ERROR;
         }
-        mObserver = pObserver;
+        mX11MonitorThread = pX11MonitorThread;
         LogRelFlowFunc(("returning VINF_SUCCESS\n"));
         return VINF_SUCCESS;
@@ -148,5 +159,5 @@
      * Update the set of visible rectangles in the host.
      */
-    void updateRects(RTRECT *pRects, size_t cRects);
+    virtual void notify(RTRECT *pRects, size_t cRects);
 
     VBoxGuestSeamlessHost(void) : mThreadFunction(this),
@@ -154,5 +165,5 @@
                                   RTTHREADFLAGS_WAITABLE, "Host events")
     {
-        mObserver = 0;
+        mX11MonitorThread = 0;
         mRunning = false;
         mState = NONE;
Index: /trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp	(revision 50323)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.cpp	(revision 50324)
@@ -24,5 +24,5 @@
 #include <VBox/log.h>
 
-#include "seamless-guest.h"
+#include "seamless-x11.h"
 
 #include <X11/Xatom.h>
@@ -71,10 +71,10 @@
   * @returns true if it can handle seamless, false otherwise
   */
-int VBoxGuestSeamlessX11::init(VBoxGuestSeamlessObserver *pObserver)
+int VBoxGuestSeamlessX11::init(VBoxGuestSeamlessHostInt *pHost)
 {
     int rc = VINF_SUCCESS;
 
     LogRelFlowFunc(("\n"));
-    if (0 != mObserver)  /* Assertion */
+    if (0 != mHost)  /* Assertion */
     {
         LogRel(("VBoxClient: ERROR: attempt to initialise seamless guest object twice!\n"));
@@ -86,5 +86,5 @@
         return VERR_ACCESS_DENIED;
     }
-    mObserver = pObserver;
+    mHost = pHost;
     LogRelFlowFunc(("returning %Rrc\n", rc));
     return rc;
@@ -299,5 +299,5 @@
     {
         updateRects();
-        mObserver->notify();
+        mHost->notify(mpRects, mcRects);
     }
     mChanged = false;
Index: /trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.h
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.h	(revision 50323)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/seamless-x11.h	(revision 50324)
@@ -23,5 +23,6 @@
 #include <iprt/avl.h>
 
-#include "seamless-guest.h"
+#include "seamless-x11.h"
+#include "seamless-host.h"
 
 #include <X11/Xlib.h>
@@ -148,5 +149,5 @@
 class VBoxGuestSeamlessX11;
 
-class VBoxGuestSeamlessX11 : public VBoxGuestSeamlessGuest
+class VBoxGuestSeamlessX11
 {
 private:
@@ -156,6 +157,6 @@
 
     // Private member variables
-    /** Pointer to the observer class. */
-    VBoxGuestSeamlessObserver *mObserver;
+    /** Pointer to the host class. */
+    VBoxGuestSeamlessHostInt *mHost;
     /** Our connection to the X11 display we are running on. */
     Display *mDisplay;
@@ -197,9 +198,10 @@
     /**
      * Initialise the guest and ensure that it is capable of handling seamless mode
-     * @param   pObserver Observer class to connect host and guest interfaces
+     * @param   pHost Host interface class to notify of window configuration
+     *                changes.
      *
      * @returns iprt status code
      */
-    int init(VBoxGuestSeamlessObserver *pObserver);
+    int init(VBoxGuestSeamlessHostInt *pHost);
 
     /**
@@ -208,9 +210,9 @@
     void uninit(void)
     {
-        if (0 != mObserver)
+        if (0 != mHost)
         {
             stop();
         }
-        mObserver = 0;
+        mHost = 0;
     }
 
@@ -241,5 +243,5 @@
 
     VBoxGuestSeamlessX11(void)
-        : mObserver(0), mDisplay(NULL), mpRects(NULL), mcRects(0),
+        : mHost(0), mDisplay(NULL), mpRects(NULL), mcRects(0),
           mSupportsShape(false), mEnabled(false), mChanged(false) {}
 
@@ -252,5 +254,3 @@
 };
 
-typedef VBoxGuestSeamlessX11 VBoxGuestSeamlessGuestImpl;
-
 #endif /* __Additions_linux_seamless_x11_h not defined */
Index: /trunk/src/VBox/Additions/x11/VBoxClient/seamless.h
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/seamless.h	(revision 50323)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/seamless.h	(revision 50324)
@@ -22,15 +22,12 @@
 
 #include "seamless-host.h"
-#include "seamless-guest.h"
-#include "seamless-glue.h"
+#include "seamless-x11.h"
 
-/** Thread function class for VBoxGuestSeamlessGuest. */
+/** Thread function class for VBoxGuestSeamlessX11. */
 class VBoxGuestSeamlessGuestThread: public VBoxGuestThreadFunction
 {
 private:
     /** The guest class "owning" us. */
-    VBoxGuestSeamlessGuestImpl *mGuest;
-    /** The guest observer monitoring the guest. */
-    VBoxGuestSeamlessObserver *mObserver;
+    VBoxGuestSeamlessX11 *mGuest;
     /** Should we exit the thread? */
     bool mExit;
@@ -41,7 +38,6 @@
 
 public:
-    VBoxGuestSeamlessGuestThread(VBoxGuestSeamlessGuestImpl *pGuest,
-                                 VBoxGuestSeamlessObserver *pObserver)
-    { mGuest = pGuest; mObserver = pObserver; mExit = false; }
+    VBoxGuestSeamlessGuestThread(VBoxGuestSeamlessX11 *pGuest)
+    { mGuest = pGuest; mExit = false; }
     virtual ~VBoxGuestSeamlessGuestThread(void) {}
     /**
@@ -74,67 +70,11 @@
 };
 
-/** Observer for the host class - start and stop seamless reporting in the guest when the
-    host requests. */
-class VBoxGuestSeamlessHostObserver : public VBoxGuestSeamlessObserver
-{
-private:
-    VBoxGuestSeamlessHost *mHost;
-    VBoxGuestThread *mGuestThread;
-
-public:
-    VBoxGuestSeamlessHostObserver(VBoxGuestSeamlessHost *pHost,
-                                  VBoxGuestThread *pGuestThread)
-    {
-        mHost = pHost;
-        mGuestThread = pGuestThread;
-    }
-
-    virtual void notify(void)
-    {
-        switch (mHost->getState())
-        {
-        case VBoxGuestSeamlessHost::ENABLE:
-             mGuestThread->start();
-            break;
-        case VBoxGuestSeamlessHost::DISABLE:
-             mGuestThread->stop(RT_INDEFINITE_WAIT, 0);
-            break;
-        default:
-            break;
-        }
-    }
-};
-
-/** Observer for the guest class - send the host updated seamless rectangle information when
-    it becomes available. */
-class VBoxGuestSeamlessGuestObserver : public VBoxGuestSeamlessObserver
-{
-private:
-    VBoxGuestSeamlessHost *mHost;
-    VBoxGuestSeamlessGuestImpl *mGuest;
-
-public:
-    VBoxGuestSeamlessGuestObserver(VBoxGuestSeamlessHost *pHost,
-                                   VBoxGuestSeamlessGuestImpl *pGuest)
-    {
-        mHost = pHost;
-        mGuest = pGuest;
-    }
-
-    virtual void notify(void)
-    {
-        mHost->updateRects(mGuest->getRects(), mGuest->getRectCount());
-    }
-};
-
 class VBoxGuestSeamless
 {
 private:
     VBoxGuestSeamlessHost mHost;
-    VBoxGuestSeamlessGuestImpl mGuest;
+    VBoxGuestSeamlessX11 mGuest;
     VBoxGuestSeamlessGuestThread mGuestFunction;
     VBoxGuestThread mGuestThread;
-    VBoxGuestSeamlessHostObserver mHostObs;
-    VBoxGuestSeamlessGuestObserver mGuestObs;
 
     bool isInitialised;
@@ -152,9 +92,9 @@
         if (RT_SUCCESS(rc))
         {
-            rc = mHost.init(&mHostObs);
+            rc = mHost.init(&mGuestThread);
         }
         if (RT_SUCCESS(rc))
         {
-            rc = mGuest.init(&mGuestObs);
+            rc = mGuest.init(&mHost);
         }
         if (RT_SUCCESS(rc))
@@ -187,8 +127,7 @@
     }
 
-    VBoxGuestSeamless() : mGuestFunction(&mGuest, &mGuestObs),
+    VBoxGuestSeamless() : mGuestFunction(&mGuest),
                           mGuestThread(&mGuestFunction, 0, RTTHREADTYPE_MSG_PUMP,
-                                       RTTHREADFLAGS_WAITABLE, "Guest events"),
-                          mHostObs(&mHost, &mGuestThread), mGuestObs(&mHost, &mGuest)
+                                       RTTHREADFLAGS_WAITABLE, "Guest events")
     {
         isInitialised = false;
Index: /trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11-auto.cpp
===================================================================
--- /trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11-auto.cpp	(revision 50323)
+++ /trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11-auto.cpp	(revision 50324)
@@ -29,4 +29,5 @@
 
 #include "../seamless.h"
+#include "../seamless-host.h"
 
 #undef DefaultRootWindow
@@ -297,15 +298,15 @@
 }
 
-/** Dummy observer class */
-class testObserver: public VBoxGuestSeamlessObserver
+/** Dummy host class */
+class testHost: public VBoxGuestSeamlessHostInt
 {
     bool mfNotified;
 public:
-    testObserver() : mfNotified(false) {}
-    virtual void notify(void)
+    testHost() : mfNotified(false) {}
+    virtual void notify(RTRECT *pRects, size_t cRects)
     {
         mfNotified = true;
     }
-    virtual ~testObserver() {}
+    virtual ~testHost() {}
     bool isNotified(void) { return mfNotified; }
 };
@@ -599,8 +600,8 @@
 {
     VBoxGuestSeamlessX11 subject;
-    testObserver observer;
+    testHost host;
     unsigned cErrs = 0;
 
-    subject.init(&observer);
+    subject.init(&host);
     smlsSetWindowAttributes(pFixture->paAttribsBefore,
                             pFixture->pahWindowsBefore,
@@ -619,5 +620,5 @@
                            pFixture->paShapeRectsAfter);
     smlsSetNextEvent(pFixture->x11EventType, pFixture->hEventWindow);
-    if (observer.isNotified())  /* Initial window tree rebuild */
+    if (host.isNotified())  /* Initial window tree rebuild */
     {
         RTPrintf("%s: fixture: %s.  Notification was set before the first event!!!\n",
@@ -626,5 +627,5 @@
     }
     subject.nextEvent();
-    if (!observer.isNotified())
+    if (!host.isNotified())
     {
         RTPrintf("%s: fixture: %s.  No notification was sent for the initial window tree rebuild.\n",
@@ -634,5 +635,5 @@
     smlsSetNextEvent(0, 0);
     subject.nextEvent();
-    if (!observer.isNotified())
+    if (!host.isNotified())
     {
         RTPrintf("%s: fixture: %s.  No notification was sent after the event.\n",
