Index: /trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UICocoaApplication.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UICocoaApplication.h	(revision 52508)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UICocoaApplication.h	(revision 52509)
@@ -47,4 +47,5 @@
 {
 public:
+
     static UICocoaApplication* instance();
     void hide();
@@ -55,11 +56,12 @@
 
     /** Register passed @a pWidget to native notification @a strNativeNotificationName, using @a pCallback as handler. */
-    void registerToNativeNotification(const QString &strNativeNotificationName, QWidget *pWidget, PfnNativeNotificationCallbackForQWidget pCallback);
+    void registerToNotificationOfWindow(const QString &strNativeNotificationName, QWidget *pWidget, PfnNativeNotificationCallbackForQWidget pCallback);
     /** Unregister passed @a pWidget from native notification @a strNativeNotificationName. */
-    void unregisterFromNativeNotification(const QString &strNativeNotificationName, QWidget *pWidget);
+    void unregisterFromNotificationOfWindow(const QString &strNativeNotificationName, QWidget *pWidget);
     /** Redirects native notification @a pstrNativeNotificationName for window @a pWindow to registered listener. */
-    void nativeNotificationProxy(NativeNSStringRef pstrNativeNotificationName, NativeNSWindowRef pWindow);
+    void nativeNotificationProxyForWidget(NativeNSStringRef pstrNativeNotificationName, NativeNSWindowRef pWindow);
 
 private:
+
     UICocoaApplication();
     static UICocoaApplication *m_pInstance;
@@ -68,5 +70,5 @@
 
     /** Map of notification callbacks registered for corresponding QWidget(s). */
-    QMap<QWidget*, QMap<QString, PfnNativeNotificationCallbackForQWidget> > m_callbacks;
+    QMap<QWidget*, QMap<QString, PfnNativeNotificationCallbackForQWidget> > m_widgetCallbacks;
 };
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UICocoaApplication.mm
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UICocoaApplication.mm	(revision 52508)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/UICocoaApplication.mm	(revision 52509)
@@ -69,7 +69,8 @@
 - (void)unsetCallback:(uint32_t)fMask :(PFNVBOXCACALLBACK)pfnCallback :(void *)pvUser;
 
-- (void)registerToNotification :(NSString*)pstrNotificationName :(NSWindow*)pWindow;
-- (void)unregisterFromNotification :(NSString*)pstrNotificationName :(NSWindow*)pWindow;
-- (void)notificationCallback :(NSNotification*)notification;
+- (void)registerToNotificationOfWindow :(NSString*)pstrNotificationName :(NSWindow*)pWindow;
+- (void)unregisterFromNotificationOfWindow :(NSString*)pstrNotificationName :(NSWindow*)pWindow;
+
+- (void)notificationCallbackOfWindow :(NSNotification*)notification;
 @end /* @interface UICocoaApplicationPrivate */
 
@@ -166,9 +167,9 @@
 
 /** Register @a pWindow to cocoa notification @a pstrNotificationName. */
-- (void) registerToNotification :(NSString*)pstrNotificationName :(NSWindow*)pWindow
+- (void) registerToNotificationOfWindow :(NSString*)pstrNotificationName :(NSWindow*)pWindow
 {
     /* Register notification observer: */
     [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(notificationCallback:)
+                                             selector:@selector(notificationCallbackOfWindow:)
                                                  name:pstrNotificationName
                                                object:pWindow];
@@ -176,5 +177,5 @@
 
 /** Unregister @a pWindow from cocoa notification @a pstrNotificationName. */
-- (void) unregisterFromNotification :(NSString*)pstrNotificationName :(NSWindow*)pWindow
+- (void) unregisterFromNotificationOfWindow :(NSString*)pstrNotificationName :(NSWindow*)pWindow
 {
     /* Uninstall notification observer: */
@@ -185,23 +186,11 @@
 
 /** Redirects cocoa @a notification to UICocoaApplication instance. */
-- (void) notificationCallback :(NSNotification*)notification
+- (void) notificationCallbackOfWindow :(NSNotification*)notification
 {
     /* Get current notification name: */
     NSString *pstrName = [notification name];
 
-    /* Define known notification names: */
-    NSString *spstrWillEnterFullscreenNotification      = @"NSWindowWillEnterFullScreenNotification";
-    NSString *spstrDidEnterFullscreenNotification       = @"NSWindowDidEnterFullScreenNotification";
-    NSString *spstrWillExitFullscreenNotification       = @"NSWindowWillExitFullScreenNotification";
-    NSString *spstrDidExitFullscreenNotification        = @"NSWindowDidExitFullScreenNotification";
-    NSString *spstrDidFailToEnterFullScreenNotification = @"NSWindowDidFailToEnterFullScreenNotification";
-
-    /* Redirect known notifications to UICocoaApplication instance: */
-    if (   [pstrName isEqualToString :spstrWillEnterFullscreenNotification]
-        || [pstrName isEqualToString :spstrDidEnterFullscreenNotification]
-        || [pstrName isEqualToString :spstrWillExitFullscreenNotification]
-        || [pstrName isEqualToString :spstrDidExitFullscreenNotification]
-        || [pstrName isEqualToString :spstrDidFailToEnterFullScreenNotification])
-        UICocoaApplication::instance()->nativeNotificationProxy(pstrName, [notification object]);
+    /* Redirect known notifications to widgets: */
+    UICocoaApplication::instance()->nativeNotificationProxyForWidget(pstrName, [notification object]);
 }
 @end /* @implementation UICocoaApplicationPrivate */
@@ -251,35 +240,36 @@
 }
 
-void UICocoaApplication::registerToNativeNotification(const QString &strNativeNotificationName, QWidget *pWidget, PfnNativeNotificationCallbackForQWidget pCallback)
+void UICocoaApplication::registerToNotificationOfWindow(const QString &strNativeNotificationName, QWidget *pWidget,
+                                                        PfnNativeNotificationCallbackForQWidget pCallback)
 {
     /* Make sure it is not registered yet: */
-    AssertReturnVoid(!m_callbacks.contains(pWidget) || !m_callbacks[pWidget].contains(strNativeNotificationName));
+    AssertReturnVoid(!m_widgetCallbacks.contains(pWidget) || !m_widgetCallbacks[pWidget].contains(strNativeNotificationName));
 
     /* Remember callback: */
-    m_callbacks[pWidget][strNativeNotificationName] = pCallback;
+    m_widgetCallbacks[pWidget][strNativeNotificationName] = pCallback;
 
     /* Register observer: */
     NativeNSStringRef pstrNativeNotificationName = darwinToNativeString(strNativeNotificationName.toLatin1().constData());
     NativeNSWindowRef pWindow = darwinToNativeWindow(pWidget);
-    [m_pNative registerToNotification :pstrNativeNotificationName :pWindow];
-}
-
-void UICocoaApplication::unregisterFromNativeNotification(const QString &strNativeNotificationName, QWidget *pWidget)
+    [m_pNative registerToNotificationOfWindow :pstrNativeNotificationName :pWindow];
+}
+
+void UICocoaApplication::unregisterFromNotificationOfWindow(const QString &strNativeNotificationName, QWidget *pWidget)
 {
     /* Make sure it is registered yet: */
-    AssertReturnVoid(m_callbacks.contains(pWidget) && m_callbacks[pWidget].contains(strNativeNotificationName));
+    AssertReturnVoid(m_widgetCallbacks.contains(pWidget) && m_widgetCallbacks[pWidget].contains(strNativeNotificationName));
 
     /* Forget callback: */
-    m_callbacks[pWidget].remove(strNativeNotificationName);
-    if (m_callbacks[pWidget].isEmpty())
-        m_callbacks.remove(pWidget);
+    m_widgetCallbacks[pWidget].remove(strNativeNotificationName);
+    if (m_widgetCallbacks[pWidget].isEmpty())
+        m_widgetCallbacks.remove(pWidget);
 
     /* Unregister observer: */
     NativeNSStringRef pstrNativeNotificationName = darwinToNativeString(strNativeNotificationName.toLatin1().constData());
     NativeNSWindowRef pWindow = darwinToNativeWindow(pWidget);
-    [m_pNative unregisterFromNotification :pstrNativeNotificationName :pWindow];
-}
-
-void UICocoaApplication::nativeNotificationProxy(NativeNSStringRef pstrNotificationName, NativeNSWindowRef pWindow)
+    [m_pNative unregisterFromNotificationOfWindow :pstrNativeNotificationName :pWindow];
+}
+
+void UICocoaApplication::nativeNotificationProxyForWidget(NativeNSStringRef pstrNotificationName, NativeNSWindowRef pWindow)
 {
     /* Get notification name: */
@@ -287,11 +277,9 @@
 
     /* Check if existing widget(s) have corresponding notification handler: */
-    const QList<QWidget*> &keys1 = m_callbacks.keys();
-    for (int i = 0; i < keys1.size(); ++i)
-    {
-        QWidget *pWidget = keys1[i];
+    foreach (QWidget *pWidget, m_widgetCallbacks.keys())
+    {
         if (darwinToNativeWindow(pWidget) == pWindow)
         {
-            const QMap<QString, PfnNativeNotificationCallbackForQWidget> &callbacks = m_callbacks[pWidget];
+            const QMap<QString, PfnNativeNotificationCallbackForQWidget> &callbacks = m_widgetCallbacks[pWidget];
             if (callbacks.contains(strNotificationName))
                 callbacks[strNotificationName](strNotificationName, pWidget);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp	(revision 52508)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineWindowFullscreen.cpp	(revision 52509)
@@ -203,14 +203,14 @@
             darwinEnableTransienceSupport(this);
         /* Register to native fullscreen notifications: */
-        UICocoaApplication::instance()->registerToNativeNotification("NSWindowWillEnterFullScreenNotification", this,
-                                                                     UIMachineWindow::handleNativeNotification);
-        UICocoaApplication::instance()->registerToNativeNotification("NSWindowDidEnterFullScreenNotification", this,
-                                                                     UIMachineWindow::handleNativeNotification);
-        UICocoaApplication::instance()->registerToNativeNotification("NSWindowWillExitFullScreenNotification", this,
-                                                                     UIMachineWindow::handleNativeNotification);
-        UICocoaApplication::instance()->registerToNativeNotification("NSWindowDidExitFullScreenNotification", this,
-                                                                     UIMachineWindow::handleNativeNotification);
-        UICocoaApplication::instance()->registerToNativeNotification("NSWindowDidFailToEnterFullScreenNotification", this,
-                                                                     UIMachineWindow::handleNativeNotification);
+        UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowWillEnterFullScreenNotification", this,
+                                                                       UIMachineWindow::handleNativeNotification);
+        UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidEnterFullScreenNotification", this,
+                                                                       UIMachineWindow::handleNativeNotification);
+        UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowWillExitFullScreenNotification", this,
+                                                                       UIMachineWindow::handleNativeNotification);
+        UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidExitFullScreenNotification", this,
+                                                                       UIMachineWindow::handleNativeNotification);
+        UICocoaApplication::instance()->registerToNotificationOfWindow("NSWindowDidFailToEnterFullScreenNotification", this,
+                                                                       UIMachineWindow::handleNativeNotification);
     }
 #endif /* Q_WS_MAC */
@@ -259,9 +259,9 @@
     {
         /* Unregister from native fullscreen notifications: */
-        UICocoaApplication::instance()->unregisterFromNativeNotification("NSWindowWillEnterFullScreenNotification", this);
-        UICocoaApplication::instance()->unregisterFromNativeNotification("NSWindowDidEnterFullScreenNotification", this);
-        UICocoaApplication::instance()->unregisterFromNativeNotification("NSWindowWillExitFullScreenNotification", this);
-        UICocoaApplication::instance()->unregisterFromNativeNotification("NSWindowDidExitFullScreenNotification", this);
-        UICocoaApplication::instance()->unregisterFromNativeNotification("NSWindowDidFailToEnterFullScreenNotification", this);
+        UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowWillEnterFullScreenNotification", this);
+        UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidEnterFullScreenNotification", this);
+        UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowWillExitFullScreenNotification", this);
+        UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidExitFullScreenNotification", this);
+        UICocoaApplication::instance()->unregisterFromNotificationOfWindow("NSWindowDidFailToEnterFullScreenNotification", this);
     }
 #endif /* Q_WS_MAC */
