From eabde3289eb34f13c2dbd9bdff38363ba0167bd9 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Thu, 6 Jun 2013 15:30:14 +0800 Subject: [PATCH] integrate vkbd-efl: back port upstream commit: 19561c61125 Ecore_Wayland: Add ecore_wl_window_surface_create() API Change-Id: I5a953a08b6e2c2cb3a32125843d8f0a556c5a4a5 --- src/lib/ecore_wayland/Ecore_Wayland.h | 11 +++++++++++ src/lib/ecore_wayland/ecore_wl_window.c | 15 ++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h b/src/lib/ecore_wayland/Ecore_Wayland.h index 65ee7c9..1b6dc89 100644 --- a/src/lib/ecore_wayland/Ecore_Wayland.h +++ b/src/lib/ecore_wayland/Ecore_Wayland.h @@ -401,6 +401,17 @@ EAPI Ecore_Wl_Dnd *ecore_wl_dnd_get(); EAPI Eina_Bool ecore_wl_dnd_start_drag(); EAPI Eina_Bool ecore_wl_dnd_selection_has_owner(Ecore_Wl_Dnd *dnd); +/** + * Returns a wl_surface with no association to any wl_shell_surface. + * + * @param win The window which will use this newly created surface. + * + * @ingroup Ecore_Wl_Window_Group + * @since 1.8 + */ +EAPI struct wl_surface *ecore_wl_window_surface_create(Ecore_Wl_Window *win); + + /** * Retrieves the Wayland Globals Interface list used for the current Wayland connection. * diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c index f808b25..48e0d6e 100644 --- a/src/lib/ecore_wayland/ecore_wl_window.c +++ b/src/lib/ecore_wayland/ecore_wl_window.c @@ -342,6 +342,17 @@ ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, in } } +EAPI struct wl_surface* +ecore_wl_window_surface_create(Ecore_Wl_Window *win) +{ + if (!win) return NULL; + if (win->surface) return NULL; + + win->surface = wl_compositor_create_surface(_ecore_wl_disp->wl.compositor); + wl_surface_set_user_data(win->surface, win); + return win->surface; +} + /** * Shows a window * @@ -360,9 +371,7 @@ ecore_wl_window_show(Ecore_Wl_Window *win) if (!win) return; if (win->surface) return; - win->surface = wl_compositor_create_surface(_ecore_wl_disp->wl.compositor); - wl_surface_set_user_data(win->surface, win); - /* wl_surface_add_listener(win->surface, &_ecore_wl_surface_listener, win); */ + ecore_wl_window_surface_create(win); win->shell_surface = wl_shell_get_shell_surface(_ecore_wl_disp->wl.shell, win->surface); -- 2.7.4