summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-08-30 12:24:16 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-08-30 14:11:47 -0500
commite7db6eec4607e78fa2e5160590f0b47b09379d93 (patch)
treef45f73bb5977cd001ece861ec6d43116178d1c33 /src/lib/ecore_wl2
parent388f8c41c88658ed8d2ae10bcec28a2b0d9a720e (diff)
ecore_wl2: Add ecore_wl2_display_flush() api
Allowing engines to explicitly flush at the right times will remove some awkwardness and bugs from our current display flush paradigm
Diffstat (limited to 'src/lib/ecore_wl2')
-rw-r--r--src/lib/ecore_wl2/Ecore_Wl2.h12
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_display.c21
2 files changed, 33 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 069ec152b8..00fe79965e 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -1943,6 +1943,18 @@ EAPI void ecore_wl2_window_frame_callback_del(Ecore_Wl2_Frame_Cb_Handle *handle)
1943 */ 1943 */
1944EAPI void ecore_wl2_window_buffer_attach(Ecore_Wl2_Window *win, void *buffer, int x, int y, Eina_Bool implicit); 1944EAPI void ecore_wl2_window_buffer_attach(Ecore_Wl2_Window *win, void *buffer, int x, int y, Eina_Bool implicit);
1945 1945
1946/**
1947 * Push buffered wayland protocol to compositor
1948 *
1949 * Wayland protocol is only actually sent when a flush occurs,
1950 * so the display should be flushed at appropriate times, such
1951 * as after a commit.
1952 *
1953 * @param display
1954 * @since 1.20
1955 */
1956EAPI void ecore_wl2_display_flush(Ecore_Wl2_Display *display);
1957
1946# endif 1958# endif
1947 1959
1948# undef EAPI 1960# undef EAPI
diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c b/src/lib/ecore_wl2/ecore_wl2_display.c
index 69838f77bc..d96405c5a8 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -1111,3 +1111,24 @@ ecore_wl2_display_name_get(const Ecore_Wl2_Display *display)
1111 EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL); 1111 EINA_SAFETY_ON_NULL_RETURN_VAL(display, NULL);
1112 return display->name; 1112 return display->name;
1113} 1113}
1114
1115EAPI void
1116ecore_wl2_display_flush(Ecore_Wl2_Display *display)
1117{
1118 int ret, code;
1119
1120 EINA_SAFETY_ON_NULL_RETURN(display);
1121
1122 ret = wl_display_flush(display->wl.display);
1123 if (ret >= 0) return;
1124
1125 code = errno;
1126 if (code == EAGAIN)
1127 {
1128 ecore_main_fd_handler_active_set(display->fd_hdl,
1129 (ECORE_FD_READ | ECORE_FD_WRITE));
1130 return;
1131 }
1132
1133 _begin_recovery_maybe(display, code);
1134}