[Tizen/Wayland] Modify event loop code 63/124563/1
authorWonsik, Jung <sidein@samsung.com>
Tue, 11 Apr 2017 23:49:09 +0000 (08:49 +0900)
committerWonsik, Jung <sidein@samsung.com>
Tue, 11 Apr 2017 23:54:37 +0000 (08:54 +0900)
To reduce CPU usage, modify event loop.
The modified code is that wait for receiving new event.

Change-Id: Ib98e9214ddadaa2233387506e53aeb000aff2d95

src/video/tizen/SDL_tizenevents.c
src/video/wayland/SDL_waylandevents.c

index c1363bd..4843c33 100755 (executable)
@@ -55,7 +55,7 @@ TranslateKeycode(int keycode)
 void
 Tizen_PumpEvents(_THIS)
 {
-    ecore_main_loop_iterate();
+    ecore_main_loop_iterate_may_block(1);
 }
 
 Ecore_IMF_Keyboard_Modifiers EcoreInputModifierToEcoreIMFModifier(unsigned int ecoreModifier)
index 4ca9483..740676d 100644 (file)
@@ -81,7 +81,7 @@ Wayland_PumpEvents(_THIS)
     }
     WAYLAND_wl_display_flush(d->display);
 
-    ret = poll(pfd, 1, 0);
+    ret = poll(pfd, 1, -1);
     if (ret < 0) {
         WAYLAND_wl_display_cancel_read(d->display);
     }