Index: /trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/VBoxUtils-darwin-cocoa.mm
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/VBoxUtils-darwin-cocoa.mm	(revision 35869)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/VBoxUtils-darwin-cocoa.mm	(revision 35870)
@@ -472,9 +472,4 @@
 }
 
-/* Make an empty interface declaration of QCocoaWindowDelegate to shut up the
-   compiler. */
-@interface QCocoaWindowDelegate: NSObject {}
-@end
-
 /* Our resize proxy singleton. This class has two major tasks. First it is used
    to proxy the windowWillResize selector of the Qt delegate. As this is class
@@ -484,4 +479,5 @@
 {
     NSMutableArray *m_pArray;
+    bool m_fInit;
 }
 +(UIResizeProxy*)sharedResizeProxy;
@@ -502,5 +498,13 @@
 -(id)init
 {
-    if ((self = [super init]))
+    self = [super init];
+
+    m_fInit = false;
+
+    return self;
+}
+- (void)addWindow:(NSWindow*)pWindow
+{
+    if (!m_fInit)
     {
         /* Create an array which contains the registered windows. */
@@ -509,5 +513,5 @@
            original method with our own one and reroute the original one to
            another name. */
-        Class oriClass = [QCocoaWindowDelegate class];
+        Class oriClass = [[pWindow delegate] class];
         Class myClass = [UIResizeProxy class];
         SEL oriSel = @selector(windowWillResize:toSize:);
@@ -521,9 +525,6 @@
         /* Add a new method to our class with the old implementation. */
         class_addMethod(oriClass, qtSel, old, method_getTypeEncoding(m3));
-    }
-    return self;
-}
-- (void)addWindow:(NSWindow*)pWindow
-{
+        m_fInit = true;
+    }
     [m_pArray addObject:pWindow];
 }
