cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=6e193e2006c376b6c48991a67ddd0cb3bd9bfa10

commit 6e193e2006c376b6c48991a67ddd0cb3bd9bfa10
Author: Romain Perier <romain.per...@openwide.fr>
Date:   Thu Jan 22 13:28:47 2015 +0100

    evas: lock and unlock focus on Cocoa view when drawing surface
    
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/modules/evas/engines/gl_cocoa/evas_engine.c        |  3 ++-
 src/modules/evas/engines/gl_cocoa/evas_engine.h        |  2 ++
 src/modules/evas/engines/gl_cocoa/evas_gl_cocoa_main.m | 12 ++++++++++++
 3 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/modules/evas/engines/gl_cocoa/evas_engine.c 
b/src/modules/evas/engines/gl_cocoa/evas_engine.c
index ea6dcf6..e0a0111 100644
--- a/src/modules/evas/engines/gl_cocoa/evas_engine.c
+++ b/src/modules/evas/engines/gl_cocoa/evas_engine.c
@@ -173,6 +173,7 @@ eng_output_redraws_rect_add(void *data, int x, int y, int 
w, int h)
 
    DBG("Redraw rect %d %d %d %d", x, y, w, h);
    re = (Render_Engine *)data;
+   eng_window_lock_focus(re->win);
    evas_gl_common_context_resize(re->win->gl_context, re->win->width, 
re->win->height, 0);
    /* simple bounding box */
    RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, re->win->width, re->win->height);
@@ -300,7 +301,7 @@ eng_output_flush(void *data, Evas_Render_Mode render_mode)
 #endif
 
    eng_window_swap_buffers(re->win);
-
+   eng_window_unlock_focus(re->win);
 }
 
 static void
diff --git a/src/modules/evas/engines/gl_cocoa/evas_engine.h 
b/src/modules/evas/engines/gl_cocoa/evas_engine.h
index b578aae..473ed7d 100644
--- a/src/modules/evas/engines/gl_cocoa/evas_engine.h
+++ b/src/modules/evas/engines/gl_cocoa/evas_engine.h
@@ -65,5 +65,7 @@ void eng_window_use(Evas_GL_Cocoa_Window *gw);
 void eng_window_swap_buffers(Evas_GL_Cocoa_Window *gw);
 void eng_window_vsync_set(int on);
 void eng_window_resize(Evas_GL_Cocoa_Window *gw, int width, int height);
+void eng_window_lock_focus(Evas_GL_Cocoa_Window *gw);
+void eng_window_unlock_focus(Evas_GL_Cocoa_Window *gw);
 
 #endif /* __EVAS_ENGINE_H__ */
diff --git a/src/modules/evas/engines/gl_cocoa/evas_gl_cocoa_main.m 
b/src/modules/evas/engines/gl_cocoa/evas_gl_cocoa_main.m
index 13bc5e3..22eecf9 100644
--- a/src/modules/evas/engines/gl_cocoa/evas_gl_cocoa_main.m
+++ b/src/modules/evas/engines/gl_cocoa/evas_gl_cocoa_main.m
@@ -140,3 +140,15 @@ eng_window_resize(Evas_GL_Cocoa_Window *gw, int width, int 
height)
   [(EvasGLView*)gw->view setFrame:view_frame];
   [[(NSOpenGLView*)gw->view openGLContext] flushBuffer];
 }
+
+void
+eng_window_lock_focus(Evas_GL_Cocoa_Window *gw)
+{
+  [(NSOpenGLView*)gw->view lockFocus];
+}
+
+void
+eng_window_unlock_focus(Evas_GL_Cocoa_Window *gw)
+{
+  [(NSOpenGLView*)gw->view unlockFocus];
+}

-- 


Reply via email to