Index: /trunk/include/VBox/VBoxGuest.h
===================================================================
--- /trunk/include/VBox/VBoxGuest.h	(revision 6841)
+++ /trunk/include/VBox/VBoxGuest.h	(revision 6842)
@@ -1430,4 +1430,6 @@
 VBGLR3DECL(int)     VbglR3GetDisplayChangeRequest(uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits,
                                                   uint32_t fEventAck, uint32_t iDisplay);
+VBGLR3DECL(int)     VbglR3DisplayChangeWaitEvent(uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits,
+                                                 uint32_t *piDisplay)
 /** @}  */
 
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp	(revision 6841)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp	(revision 6842)
@@ -22,4 +22,5 @@
 #include <iprt/string.h>
 #include <iprt/mem.h>
+#include <iprt/assert.h>
 
 #include "VBGLR3Internal.h"
@@ -146,2 +147,55 @@
     return rc;
 }
+
+/**
+ * Wait for a display change request event from the host.  These events must have been
+ * activated previously using VbglR3CtlFilterMask.
+ *
+ * @returns IPRT status value
+ * @param   pcx       on success, where to return the requested display width.  0 means no
+ *                    change.
+ * @param   pcy       on success, where to return the requested display height.  0 means no
+ *                    change.
+ * @param   pcBits    on success, where to return the requested bits per pixel.  0 means no
+ *                    change.
+ * @param   piDisplay on success, where to return the index of the display to be changed.
+ */
+VBGLR3DECL(int) VbglR3DisplayChangeWaitEvent(uint32_t *pcx, uint32_t *pcy, uint32_t *pcBits,
+                                             uint32_t *piDisplay)
+{
+    VBoxGuestWaitEventInfo waitEvent;
+    int rc;
+
+#ifndef VBOX_VBGLR3_XFREE86
+    AssertPtrReturn(pcx, VERR_INVALID_PARAMETER);
+    AssertPtrReturn(pcy, VERR_INVALID_PARAMETER);
+    AssertPtrReturn(pcBits, VERR_INVALID_PARAMETER);
+    AssertPtrReturn(piDisplay, VERR_INVALID_PARAMETER);
+#endif
+    waitEvent.u32TimeoutIn = RT_INDEFINITE_WAIT;
+    waitEvent.u32EventMaskIn = VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST;
+    rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_WAITEVENT, &waitEvent, sizeof(waitEvent));
+    if (RT_SUCCESS(rc))
+    {
+        /* did we get the right event? */
+        if (waitEvent.u32EventFlagsOut & VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST)
+        {
+            VMMDevDisplayChangeRequest2 Req = { { 0 } };
+            vmmdevInitRequest(&Req.header, VMMDevReq_GetDisplayChangeRequest2);
+            Req.eventAck = VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST;
+            int rc = vbglR3GRPerform(&Req.header);
+            if (RT_SUCCESS(rc))
+                rc = Req.header.rc;
+            if (RT_SUCCESS(rc))
+            {
+                *pcx = Req.xres;
+                *pcy = Req.yres;
+                *pcBits = Req.bpp;
+                *piDisplay = Req.display;
+            }
+        }
+        else
+            rc = VERR_TRY_AGAIN;
+    }
+    return rc;
+}
