summaryrefslogtreecommitdiff
path: root/src/lib/ecore_cocoa/ecore_cocoa_app.m
diff options
context:
space:
mode:
authorNicolas Aguirre <aguirre.nicolas@gmail.com>2015-08-06 23:33:24 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-10-13 15:40:00 -0700
commit44e945abbbd1c6962d9db9ccadbe8c2c9218826a (patch)
treed2b7f46d0f53cf8ec186b2a892cb0265be9f82cc /src/lib/ecore_cocoa/ecore_cocoa_app.m
parente9c2d076965e60349e69eb7e6d842eb711d62f52 (diff)
ecore_cocoa: use a timer instead of a poller to be more responsive when dealing with cocoa Event.
As all Mouse and Keyboard events comme from Cocoa, the poll period must be reduced. Backwards of this method is that when no signal are received for a long period, the timer fired anyway and consumes CPU for nothig but it seems there is no easy method to integrate NSApplication mainloop into an existing one. Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to '')
-rw-r--r--src/lib/ecore_cocoa/ecore_cocoa_app.m8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/lib/ecore_cocoa/ecore_cocoa_app.m b/src/lib/ecore_cocoa/ecore_cocoa_app.m
index d05070a586..00bdbfacac 100644
--- a/src/lib/ecore_cocoa/ecore_cocoa_app.m
+++ b/src/lib/ecore_cocoa/ecore_cocoa_app.m
@@ -71,12 +71,8 @@ _ecore_cocoa_run_loop_cb(void *data EINA_UNUSED)
71 _running = 1; 71 _running = 1;
72 _expiration = [NSDate distantPast]; 72 _expiration = [NSDate distantPast];
73 73
74 _poller = ecore_poller_add(ECORE_POLLER_CORE, 74 _timer = ecore_timer_add(ECORE_COCOA_MAINLOOP_PERIOD,
75 ecore_poller_poll_interval_get(ECORE_POLLER_CORE), 75 _ecore_cocoa_run_loop_cb, NULL);
76 _ecore_cocoa_run_loop_cb, NULL);
77 if (_poller == NULL) {
78 // XXX ERROR
79 }
80} 76}
81 77
82 78