Index: /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 17200)
+++ /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 17201)
@@ -153,5 +153,5 @@
 VirtualBox_DEFS.darwin    = VBOX_GUI_USE_QUARTZ2D VBOX_GUI_USE_QIMAGE VBOX_WITHOUT_QHTTP
 ifndef VBOX_WITH_COCOA_QT
-VirtualBox_DEFS.darwin.x86= VBOX_GUI_USE_QUARTZ2D USE_HID_FOR_MODIFIERS
+VirtualBox_DEFS.darwin.x86= USE_HID_FOR_MODIFIERS
 endif
 VirtualBox_DEFS.freebsd   = VBOX_GUI_USE_QIMAGE VBOX_GUI_USE_SDL
Index: /trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h	(revision 17200)
+++ /trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleWnd.h	(revision 17201)
@@ -41,11 +41,5 @@
 #endif
 #ifdef Q_WS_MAC
-# ifdef QT_MAC_USE_COCOA
-    /** @todo Carbon -> Cocoa */
-# else
-#  undef PAGE_SIZE
-#  undef PAGE_SHIFT
-#  include <Carbon/Carbon.h>
-# endif
+# include <ApplicationServices/ApplicationServices.h>
 #endif
 
@@ -396,10 +390,6 @@
     QRect mNormalGeometry;
     Qt::WindowFlags mSavedFlags;
-# ifdef QT_MAC_USE_COCOA
-    /** @todo Carbon -> Cocoa */
-# else
     /* For the fade effect if the the window goes fullscreen */
     CGDisplayFadeReservationToken mFadeToken;
-# endif
 #endif
 };
Index: /trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils-darwin.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils-darwin.h	(revision 17200)
+++ /trunk/src/VBox/Frontends/VirtualBox/include/VBoxUtils-darwin.h	(revision 17201)
@@ -41,4 +41,6 @@
 # include <iprt/cdefs.h> /* for __BEGIN_DECLS/__END_DECLS & stuff */
 # include <qglobal.h> /* for QT_MAC_USE_COCOA */
+
+# include <ApplicationServices/ApplicationServices.h>
 class QWidget;
 class QToolBar;
@@ -65,4 +67,5 @@
  ********************************************************************************/
 NativeWindowRef darwinToNativeWindowImpl (NativeViewRef aView);
+NativeViewRef darwinToNativeViewImpl (NativeWindowRef aWindow);
 
 /********************************************************************************
@@ -74,4 +77,5 @@
 void darwinSetShowsResizeIndicatorImpl (NativeWindowRef aWindow, bool aEnabled);
 void darwinSetHidesAllTitleButtonsImpl (NativeWindowRef aWindow);
+void darwinSetShowsWindowTransparentImpl (NativeWindowRef aWindow, bool aEnabled);
 void darwinSetMouseCoalescingEnabled (bool aEnabled);
 
@@ -82,4 +86,7 @@
  ********************************************************************************/
 void darwinWindowAnimateResizeImpl (NativeWindowRef aWindow, int x, int y, int width, int height);
+void darwinWindowInvalidateShapeImpl (NativeWindowRef aWindow);
+void darwinWindowInvalidateShadowImpl (NativeWindowRef aWindow);
+
 
 __END_DECLS
@@ -119,4 +126,12 @@
 NativeWindowRef darwinToNativeWindow (NativeViewRef aView);
 
+/**
+ * Returns a reference to the native View of the Window.
+ *
+ * @returns either HIViewRef or NSView* of the Window.
+ * @param   aWidget   Pointer to the native Window
+ */
+NativeViewRef darwinToNativeView (NativeWindowRef aWindow);
+
 /********************************************************************************
  *
@@ -127,4 +142,5 @@
 void darwinSetShowsResizeIndicator (QWidget *aWidget, bool aEnabled);
 void darwinSetHidesAllTitleButtons (QWidget *aWidget);
+void darwinSetShowsWindowTransparent (QWidget *aWidget, bool aEnabled);
 void darwinDisableIconsInMenus (void);
 
@@ -135,8 +151,8 @@
  ********************************************************************************/
 void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget);
+void darwinWindowInvalidateShape (QWidget *aWidget);
+void darwinWindowInvalidateShadow (QWidget *aWidget);
 QString darwinSystemLanguage (void);
 QPixmap darwinCreateDragPixmap (const QPixmap& aPixmap, const QString &aText);
-
-
 
 
@@ -166,4 +182,7 @@
     return static_cast<CGContext *> (aWidget->macCGHandle());
 }
+
+DECLINLINE(CGRect) darwinToCGRect (const QRect& aRect) { return CGRectMake (aRect.x(), aRect.y(), aRect.width(), aRect.height()); }
+DECLINLINE(CGRect) darwinFlipCGRect (CGRect aRect, int aTargetHeight) { aRect.origin.y = aTargetHeight - aRect.origin.y - aRect.size.height; return aRect; }
 
 # ifndef QT_MAC_USE_COCOA
@@ -202,5 +221,4 @@
 bool darwinIsMenuOpen (void);
 
-void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget);
 # endif /* !QT_MAC_USE_COCOA */
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp	(revision 17200)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp	(revision 17201)
@@ -1167,10 +1167,6 @@
     {
         /* Fade back to the normal gamma */
-# ifdef QT_MAC_USE_COCOA
-        /** @todo Carbon -> Cocoa */
-# else
         CGDisplayFade (mFadeToken, 0.5, kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0.0, 0.0, 0.0, false);
         CGReleaseDisplayFadeReservation (mFadeToken);
-# endif
     }
     console->setMouseCoalescingEnabled (true);
@@ -1266,11 +1262,5 @@
             {
                 /* Clear the background */
-# ifdef QT_MAC_USE_COCOA
-                /** @todo Carbon -> Cocoa */
-# else
-                HIRect viewRect;
-                HIViewGetBounds (::darwinToNativeView (this), &viewRect);
-                CGContextClearRect (::darwinToCGContextRef (this), viewRect);
-# endif
+                CGContextClearRect (::darwinToCGContextRef (this), ::darwinToCGRect (frameGeometry()));
             }
             break;
@@ -2250,10 +2240,6 @@
     {
         /* Fade to black */
-# ifdef QT_MAC_USE_COCOA
-        /** @todo Carbon -> Cocoa */
-# else
         CGAcquireDisplayFadeReservation (kCGMaxDisplayReservationInterval, &mFadeToken);
         CGDisplayFade (mFadeToken, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, true);
-# endif
     }
 #endif
@@ -2381,19 +2367,5 @@
              * calls. */
             /* Undo all mac specific installations */
-# ifdef QT_MAC_USE_COCOA
-            /** @todo Carbon -> Cocoa */
-# else  /* !QT_MAC_USE_COCOA */
-            OSStatus status;
-            WindowRef windowRef = ::darwinToNativeWindow (this);
-            Assert (VALID_PTR (windowRef));
-            /* See above.
-            status = RemoveEventHandler (mDarwinRegionEventHandlerRef);
-            AssertCarbonOSStatus (status);
-            */
-            status = ReshapeCustomWindow (windowRef);
-            AssertCarbonOSStatus (status);
-            status = SetWindowAlpha (windowRef, 1.0);
-            AssertCarbonOSStatus (status);
-# endif /* !QT_MAC_USE_COCOA */
+            ::darwinSetShowsWindowTransparent (this, false);
         }
 #endif
@@ -2428,44 +2400,5 @@
          * switch and make this stuff useless with the old winId. So please be
          * careful on rearrangement of the method calls. */
-# ifdef QT_MAC_USE_COCOA
-        /** @todo Carbon -> Cocoa */
-# else  /* !QT_MAC_USE_COCOA */
-        OSStatus status;
-        HIViewRef viewRef = ::darwinToNativeView (console->viewport());
-        Assert (VALID_PTR (viewRef));
-        WindowRef windowRef = ::darwinToNativeWindow (viewRef);
-        Assert (VALID_PTR (windowRef));
-        /* @todo=poetzsch: Currently this isn't necessary. I should
-         * investigate if we can/should use this. */
-        /*
-           EventTypeSpec wCompositingEvent = { kEventClassWindow, kEventWindowGetRegion };
-           status = InstallWindowEventHandler ((WindowPtr)winId(), DarwinRegionHandler, GetEventTypeCount (wCompositingEvent), &wCompositingEvent, &mCurrRegion, &mDarwinRegionEventHandlerRef);
-           AssertCarbonOSStatus (status);
-           HIViewRef contentView = 0;
-           status = HIViewFindByID(HIViewGetRoot(windowRef), kHIViewWindowContentID, &contentView);
-           AssertCarbonOSStatus (status);
-           EventTypeSpec drawEvent = { kEventClassControl, kEventControlDraw };
-           status = InstallControlEventHandler (contentView, DarwinRegionHandler, GetEventTypeCount (drawEvent), &drawEvent, &contentView, NULL);
-           AssertCarbonOSStatus (status);
-           */
-        UInt32 features;
-        status = GetWindowFeatures (windowRef, &features);
-        AssertCarbonOSStatus (status);
-        if (( features & kWindowIsOpaque ) != 0)
-        {
-            status = HIWindowChangeFeatures (windowRef, 0, kWindowIsOpaque);
-            AssertCarbonOSStatus (status);
-        }
-        status = HIViewReshapeStructure (viewRef);
-        AssertCarbonOSStatus (status);
-        status = SetWindowAlpha(windowRef, 0.999);
-        AssertCarbonOSStatus (status);
-        /* For now disable the shadow of the window. This feature cause errors
-         * if a window in vbox looses focus, is reselected and than moved. */
-        /** @todo Search for an option to enable this again. A shadow on every
-         * window has a big coolness factor. */
-        status = ChangeWindowAttributes (windowRef, kWindowNoShadowAttribute, 0);
-        AssertCarbonOSStatus (status);
-# endif /* !QT_MAC_USE_COCOA */
+        ::darwinSetShowsWindowTransparent (this, true);
     }
 #endif
@@ -2513,10 +2446,9 @@
 {
 #ifdef Q_WS_MAC
-# ifdef QT_MAC_USE_COCOA
-    /** @todo Carbon -> Cocoa */
-# else  /* !QT_MAC_USE_COCOA */
+# ifndef QT_MAC_USE_COCOA
     /* setWindowState removes the window group connection somehow. So save it
      * temporary. */
     WindowGroupRef g = GetWindowGroup (::darwinToNativeWindow (this));
+# endif  /* !QT_MAC_USE_COCOA */
     if (aSeamless)
         if (aOn)
@@ -2526,5 +2458,7 @@
             mSavedFlags = windowFlags();
             /* Remove the frame from the window */
+            const QRect fullscreen (qApp->desktop()->screenGeometry (qApp->desktop()->screenNumber (this)));
             setParent (0, Qt::Window | Qt::FramelessWindowHint | (windowFlags() & 0xffff0000));
+            setGeometry (fullscreen);
             /* Set it maximized */
             setWindowState (windowState() ^ Qt::WindowMaximized);
@@ -2539,4 +2473,5 @@
         /* Here we are going really fullscreen */
         setWindowState (windowState() ^ Qt::WindowFullScreen);
+# ifndef QT_MAC_USE_COCOA
     /* Reassign the correct window group. */
     SetWindowGroup (::darwinToNativeWindow (this), g);
@@ -3031,9 +2966,5 @@
          * an repaint only. All the magic clipping stuff is done
          * in the paint engine. */
-#ifndef QT_MAC_USE_COCOA
-        HIViewReshapeStructure (::darwinToNativeView (console->viewport()));
-#endif /* QT_MAC_USE_COCOA */
-//        HIWindowInvalidateShadow (::darwinToWindowRef (console->viewport()));
-//        ReshapeCustomWindow (::darwinToWindowRef (this));
+        ::darwinWindowInvalidateShape (console->viewport());
     }
     else
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBQuartz2D.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBQuartz2D.cpp	(revision 17200)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBQuartz2D.cpp	(revision 17201)
@@ -133,5 +133,5 @@
         CGRect *cgRct = &rgnRcts->rcts[rgnRcts->used];
         cgRct->origin.x = rect.x();
-        cgRct->origin.y = rect.y();
+        cgRct->origin.y = height() - rect.y() - rect.height();
         cgRct->size.width = rect.width();
         cgRct->size.height = rect.height();
@@ -159,18 +159,18 @@
     Assert (mImage);
 
-#ifndef QT_MAC_USE_COCOA
     VBoxConsoleWnd *main = qobject_cast <VBoxConsoleWnd *> (vboxGlobal().mainWindow());
     Assert (VALID_PTR (main));
     QWidget* viewport = mView->viewport();
     Assert (VALID_PTR (viewport));
-
-    HIViewRef viewRef = ::darwinToNativeView (viewport);
-    Assert (VALID_PTR (viewRef));
-    /* Get the dimensions of this HIView */
-    HIRect viewRect;
-    HIViewGetBounds (viewRef, &viewRect);
-    /* Get the context of this window from qt */
+    /* Get the dimensions of the viewport */
+    CGRect viewRect = ::darwinToCGRect (viewport->geometry());
+    /* Get the context of this window from Qt */
     CGContextRef ctx = ::darwinToCGContextRef (viewport);
     Assert (VALID_PTR (ctx));
+
+    /* Flip the context */
+    CGContextTranslateCTM (ctx, 0, viewRect.size.height);
+    CGContextScaleCTM (ctx, 1.0, -1.0);
+
     /* We handle the seamless mode as a special case. */
     if (main->isTrueSeamless())
@@ -215,5 +215,5 @@
         CGContextClipToRect (ctx, viewRect);
         /* At this point draw the real vm image */
-        HIViewDrawCGImage (ctx, &viewRect, subImage);
+        CGContextDrawImage (ctx, ::darwinFlipCGRect (viewRect, viewRect.size.height), subImage);
 #ifdef COMP_WITH_SHADOW
         CGContextEndTransparencyLayer (ctx);
@@ -230,7 +230,7 @@
         CGImageRef subImage;
         if (!mView->pauseShot().isNull())
-            subImage = CGImageCreateWithImageInRect (::darwinToCGImageRef (&mView->pauseShot()), ::darwinToHIRect (is));
+            subImage = CGImageCreateWithImageInRect (::darwinToCGImageRef (&mView->pauseShot()), ::darwinToCGRect (is));
         else
-            subImage = CGImageCreateWithImageInRect (mImage, ::darwinToHIRect (is));
+            subImage = CGImageCreateWithImageInRect (mImage, ::darwinToCGRect (is));
         Assert (VALID_PTR (subImage));
         /* Ok, for more performance we set a clipping path of the
@@ -242,5 +242,5 @@
             /* Add all region rects to the current context as path components */
             for (int i = 0; i < a.size(); ++i)
-                CGContextAddRect (ctx, ::darwinToHIRect (a[i]));
+                CGContextAddRect (ctx, ::darwinFlipCGRect (::darwinToCGRect (a[i]), viewRect.size.height));
             /* Now convert the path to a clipping path. */
             CGContextClip (ctx);
@@ -250,8 +250,6 @@
         CGContextClipToRect (ctx, viewRect);
         /* At this point draw the real vm image */
-        HIRect destRect = ::darwinToHIRect (ir);
-        HIViewDrawCGImage (ctx, &destRect, subImage);
-    }
-#endif /* QT_MAC_USE_COCOA */
+        CGContextDrawImage (ctx, ::darwinFlipCGRect (::darwinToCGRect (ir), viewRect.size.height), subImage);
+    }
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-carbon.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-carbon.cpp	(revision 17200)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-carbon.cpp	(revision 17201)
@@ -35,22 +35,86 @@
 }
 
+NativeViewRef darwinToNativeViewImpl (NativeWindowRef aWindow)
+{
+    NativeViewRef view = NULL;
+    if (aWindow)
+    {
+        OSStatus result = GetRootControl (aWindow, &view);
+        AssertCarbonOSStatus (result);
+    }
+    return view;
+}
+
 void darwinSetShowsToolbarButtonImpl (NativeWindowRef aWindow, bool aEnabled)
 {
-    int err = ::ChangeWindowAttributes (aWindow, aEnabled ? kWindowToolbarButtonAttribute : kWindowNoAttributes,
-                                                 aEnabled ? kWindowNoAttributes : kWindowToolbarButtonAttribute);
-    AssertCarbonOSStatus (err);
+    OSStatus result = ::ChangeWindowAttributes (aWindow, aEnabled ? kWindowToolbarButtonAttribute : kWindowNoAttributes,
+                                                         aEnabled ? kWindowNoAttributes : kWindowToolbarButtonAttribute);
+    AssertCarbonOSStatus (result);
 }
 
 void darwinSetShowsResizeIndicatorImpl (NativeWindowRef aWindow, bool aEnabled)
 {
-    int err = ::ChangeWindowAttributes (aWindow, aEnabled ? kWindowResizableAttribute : kWindowNoAttributes,
-                                                 aEnabled ? kWindowNoAttributes : kWindowResizableAttribute);
-    AssertCarbonOSStatus (err);
+    OSStatus result = ::ChangeWindowAttributes (aWindow, aEnabled ? kWindowResizableAttribute : kWindowNoAttributes,
+                                                         aEnabled ? kWindowNoAttributes : kWindowResizableAttribute);
+    AssertCarbonOSStatus (result);
+}
+
+void darwinSetShowsWindowTransparentImpl (NativeWindowRef aWindow, bool aEnabled)
+{
+    Assert (VALID_PTR (aWindow));
+    OSStatus result;
+    if (aEnabled)
+    {
+        HIViewRef viewRef = ::darwinToNativeViewImpl (aWindow);
+        Assert (VALID_PTR (viewRef));
+        /* @todo=poetzsch: Currently this isn't necessary. I should
+         * investigate if we can/should use this. */
+        /*
+           EventTypeSpec wCompositingEvent = { kEventClassWindow, kEventWindowGetRegion };
+           status = InstallWindowEventHandler ((WindowPtr)winId(), DarwinRegionHandler, GetEventTypeCount (wCompositingEvent), &wCompositingEvent, &mCurrRegion, &mDarwinRegionEventHandlerRef);
+           AssertCarbonOSStatus (status);
+           HIViewRef contentView = 0;
+           status = HIViewFindByID(HIViewGetRoot(windowRef), kHIViewWindowContentID, &contentView);
+           AssertCarbonOSStatus (status);
+           EventTypeSpec drawEvent = { kEventClassControl, kEventControlDraw };
+           status = InstallControlEventHandler (contentView, DarwinRegionHandler, GetEventTypeCount (drawEvent), &drawEvent, &contentView, NULL);
+           AssertCarbonOSStatus (status);
+         */
+        UInt32 features;
+        result = ::GetWindowFeatures (aWindow, &features);
+        AssertCarbonOSStatus (result);
+        if (( features & kWindowIsOpaque ) != 0)
+        {
+            result = ::HIWindowChangeFeatures (aWindow, 0, kWindowIsOpaque);
+            AssertCarbonOSStatus (result);
+        }
+        result = ::HIViewReshapeStructure (viewRef);
+        AssertCarbonOSStatus (result);
+        result = ::SetWindowAlpha (aWindow, 0.999);
+        AssertCarbonOSStatus (result);
+        /* For now disable the shadow of the window. This feature cause errors
+         * if a window in vbox looses focus, is reselected and than moved. */
+        /** @todo Search for an option to enable this again. A shadow on every
+         * window has a big coolness factor. */
+        result = ::ChangeWindowAttributes (aWindow, kWindowNoShadowAttribute, 0);
+        AssertCarbonOSStatus (result);
+    }
+    else
+    {
+        /* See above.
+           status = RemoveEventHandler (mDarwinRegionEventHandlerRef);
+           AssertCarbonOSStatus (status);
+         */
+        result = ::ReshapeCustomWindow (aWindow);
+        AssertCarbonOSStatus (result);
+        result = ::SetWindowAlpha (aWindow, 1.0);
+        AssertCarbonOSStatus (result);
+    }
 }
 
 void darwinSetMouseCoalescingEnabled (bool aEnabled)
 {
-    int err = ::SetMouseCoalescingEnabled (aEnabled, NULL);
-    AssertCarbonOSStatus (err);
+    OSStatus result = ::SetMouseCoalescingEnabled (aEnabled, NULL);
+    AssertCarbonOSStatus (result);
 }
 
@@ -58,13 +122,20 @@
 {
     HIRect r = CGRectMake (x, y, width, height);
-    int err = ::TransitionWindowWithOptions (aWidget,
-                                             kWindowSlideTransitionEffect,
-                                             kWindowResizeTransitionAction,
-                                             &r,
-                                             false,
-                                             NULL);
-    AssertCarbonOSStatus (err);
-}
-
+    OSStatus result = ::TransitionWindowWithOptions (aWidget,
+                                                     kWindowSlideTransitionEffect,
+                                                     kWindowResizeTransitionAction,
+                                                     &r,
+                                                     false,
+                                                     NULL);
+    AssertCarbonOSStatus (result);
+}
+
+void darwinWindowInvalidateShapeImpl (NativeWindowRef aWindow)
+{
+    OSStatus result = HIViewReshapeStructure (::darwinToNativeViewImpl (aWindow));
+    AssertCarbonOSStatus (result);
+//    HIWindowInvalidateShadow (::darwinToWindowRef (console->viewport()));
+//    ReshapeCustomWindow (::darwinToWindowRef (this));
+}
 
 /********************************************************************************
@@ -74,16 +145,4 @@
  ********************************************************************************/
 #include "VBoxConsoleView.h"
-
-/**
- * Callback for deleting the QImage object when CGImageCreate is done
- * with it (which is probably not until the returned CFGImageRef is released).
- *
- * @param   info        Pointer to the QImage.
- */
-static void darwinDataProviderReleaseQImage (void *info, const void *, size_t)
-{
-    QImage *qimg = (QImage *)info;
-    delete qimg;
-}
 
 bool darwinIsMenuOpen (void)
Index: /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-cocoa.m
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-cocoa.m	(revision 17200)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin-cocoa.m	(revision 17201)
@@ -28,4 +28,5 @@
 #import <AppKit/NSEvent.h>
 #import <AppKit/NSToolbar.h>
+#import <AppKit/NSColor.h>
 
 NativeWindowRef darwinToNativeWindowImpl (NativeViewRef aView)
@@ -33,4 +34,11 @@
     if (aView)
         return [aView window];
+    return NULL;
+}
+
+NativeViewRef darwinToNativeViewImpl (NativeWindowRef aWindow)
+{
+    if (aWindow)
+        return [aWindow contentView];   
     return NULL;
 }
@@ -60,4 +68,20 @@
     if (iconButton != Nil)
         [iconButton setHidden:YES];
+}
+
+void darwinSetShowsWindowTransparentImpl (NativeWindowRef aWindow, bool aEnabled)
+{
+    if (aEnabled)
+    {
+        [aWindow setOpaque:NO];
+        [aWindow setBackgroundColor:[NSColor clearColor]];
+        [aWindow setHasShadow:NO];
+    }
+    else
+    {
+        [aWindow setOpaque:YES];
+        [aWindow setBackgroundColor:[NSColor windowBackgroundColor]];
+        [aWindow setHasShadow:YES];
+    }
 }
 
@@ -90,2 +114,7 @@
 }
 
+void darwinWindowInvalidateShadowImpl (NativeWindowRef aWindow)
+{
+    [aWindow invalidateShadow];
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.cpp	(revision 17200)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxUtils-darwin.cpp	(revision 17201)
@@ -51,4 +51,9 @@
 }
 
+NativeViewRef darwinToNativeView (NativeWindowRef aWindow)
+{
+    return ::darwinToNativeViewImpl (aWindow);
+}
+
 void darwinSetShowsToolbarButton (QToolBar *aToolBar, bool aEnabled)
 {
@@ -56,9 +61,4 @@
     if (parent)
         ::darwinSetShowsToolbarButtonImpl (::darwinToNativeWindow (parent), aEnabled);
-}
-
-void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget)
-{
-    ::darwinWindowAnimateResizeImpl (::darwinToNativeWindow (aWidget), aTarget.x(), aTarget.y(), aTarget.width(), aTarget.height());
 }
 
@@ -71,4 +71,33 @@
     NOREF (aWidget);
 #endif /* !QT_MAC_USE_COCOA */
+}
+
+void darwinSetShowsWindowTransparent (QWidget *aWidget, bool aEnabled)
+{
+    ::darwinSetShowsWindowTransparentImpl (::darwinToNativeWindow (aWidget), aEnabled);
+}
+
+void darwinWindowAnimateResize (QWidget *aWidget, const QRect &aTarget)
+{
+    ::darwinWindowAnimateResizeImpl (::darwinToNativeWindow (aWidget), aTarget.x(), aTarget.y(), aTarget.width(), aTarget.height());
+}
+
+void darwinWindowInvalidateShape (QWidget *aWidget)
+{
+#ifdef QT_MAC_USE_COCOA
+    /* Here a simple update is enough! */
+    aWidget->update();
+#else /* QT_MAC_USE_COCOA */
+    ::darwinWindowInvalidateShapeImpl (::darwinToNativeWindow (aWidget));
+#endif /* QT_MAC_USE_COCOA */
+}
+;
+void darwinWindowInvalidateShadow (QWidget *aWidget)
+{
+#ifdef QT_MAC_USE_COCOA
+    ::darwinWindowInvalidateShadowImpl (::darwinToNativeWindow (aWidget));
+#else /* QT_MAC_USE_COCOA */
+    NOREF (aWidget);
+#endif /* QT_MAC_USE_COCOA */
 }
 
@@ -110,4 +139,5 @@
 #endif /* QT_VERSION >= 0x040400 */
 }
+
 
 /* Proxy icon creation */
