ecore_cocoa: NSApp must be configured in the App wrapper 01/82901/3
authorJean Guyomarc'h <jean.guyomarch@openwide.fr>
Thu, 15 Oct 2015 12:02:44 +0000 (14:02 +0200)
committerHermet Park <chuneon.park@samsung.com>
Fri, 2 Sep 2016 03:02:27 +0000 (20:02 -0700)
Change-Id: Ib5c424605eae8a593dd683b290889a80b8620d0b
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/ecore_cocoa/ecore_cocoa_app.m
src/lib/ecore_cocoa/ecore_cocoa_window.m

index bb74d53..648bf87 100644 (file)
@@ -56,6 +56,13 @@ _ecore_cocoa_run_loop_cb(void *data EINA_UNUSED)
       return nil;
    }
    NSApp = self; // NSApp is used EVERYWHERE! Set it right now!
+
+   /* Set the process to be a foreground process,
+    * without that it prevents the window to become the key window and
+    * receive all mouse mouve events. */
+   [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
+   [NSApp activateIgnoringOtherApps:YES];
+
    return NSApp;
 }
 
index 670b530..e4c904e 100644 (file)
@@ -286,20 +286,12 @@ ecore_cocoa_window_new(int x,
                                                 styleMask:style
                                                 backing:NSBackingStoreBuffered
                                                   defer:NO];
-
    if (EINA_UNLIKELY(!window))
      {
         CRI("Failed to create EcoreCocoaWindow");
         return NULL;
      }
 
-   //Set the process to be a foreground process,
-   //without that it prevents the window to become the key window and
-   //receive all mouse mouve events.
-   [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
-   [NSApp activateIgnoringOtherApps:YES];
-
-
    w = calloc(1, sizeof(Ecore_Cocoa_Window));
    if (EINA_UNLIKELY(w == NULL))
      {