From abfb33d0ebbfea4e3cbef070e22f5646b719a9a6 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Fri, 17 Apr 2015 16:25:13 +0900 Subject: [PATCH] temporary fix: save the client request information to e_pixmap Change-Id: I5e7f75fc76f844804964ed2331163f1b9df4aa33 --- src/bin/e_comp_wl.c | 9 +++++++++ src/bin/e_comp_wl.h | 2 ++ src/bin/e_pixmap.c | 19 +++++++++++++++++++ src/bin/e_pixmap.h | 2 ++ src/modules/wl_desktop_shell/e_scaler.c | 5 +---- 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index 0752367acd..2580347bb3 100644 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -1679,6 +1679,9 @@ _e_comp_wl_compositor_cb_surface_create(struct wl_client *client, struct wl_reso /* set reference to pixmap so we can fetch it later */ wl_resource_set_user_data(res, ep); + E_Comp_Wl_Client_Data *cdata = e_pixmap_cdata_get(ep); + cdata->wl_surface = res; + /* emit surface create signal */ wl_signal_emit(&comp->wl_comp_data->signals.surface.create, res); } @@ -2338,6 +2341,12 @@ _e_comp_wl_client_cb_new(void *data EINA_UNUSED, E_Client *ec) /* add this client to the hash */ /* eina_hash_add(clients_win_hash, &win, ec); */ e_hints_client_list_set(); + + E_Comp_Wl_Client_Data *cdata = e_pixmap_cdata_get(ec->pixmap); + struct wl_resource *wl_resource = cdata->wl_surface; + ec->comp_data->scaler = cdata->scaler; + e_pixmap_cdata_set(ec->pixmap, ec->comp_data); + _e_comp_wl_surface_cb_commit(NULL, wl_resource); } static void diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h index 1d9efedcf2..2ce5488f25 100644 --- a/src/bin/e_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -261,6 +261,8 @@ struct _E_Comp_Wl_Data struct _E_Comp_Wl_Client_Data { + struct wl_resource *wl_surface; + Ecore_Timer *first_draw_tmr; struct diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c index 5bb244503a..22ffb8c9fa 100644 --- a/src/bin/e_pixmap.c +++ b/src/bin/e_pixmap.c @@ -36,6 +36,8 @@ struct _E_Pixmap struct wl_listener buffer_destroy_listener; void *data; Eina_Rectangle opaque; + + E_Comp_Wl_Client_Data *cdata; #endif Eina_Bool usable : 1; @@ -140,6 +142,7 @@ _e_pixmap_new(E_Pixmap_Type type) cp->w = cp->h = 0; cp->refcount = 1; cp->dirty = 1; + cp->cdata = calloc(1, sizeof(E_Comp_Wl_Client_Data)); return cp; } @@ -949,3 +952,19 @@ e_pixmap_image_opaque_get(E_Pixmap *cp, int *x, int *y, int *w, int *h) if (h) *h = 0; #endif } + +EAPI E_Comp_Client_Data * +e_pixmap_cdata_get(E_Pixmap *cp) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(cp, NULL); + return (E_Comp_Client_Data*)cp->cdata; +} + +EAPI void +e_pixmap_cdata_set(E_Pixmap *cp, E_Comp_Client_Data *cdata) +{ + EINA_SAFETY_ON_NULL_RETURN(cp); + EINA_SAFETY_ON_NULL_RETURN(cdata); + free (cp->cdata); + cp->cdata = (E_Comp_Wl_Client_Data*)cdata; +} diff --git a/src/bin/e_pixmap.h b/src/bin/e_pixmap.h index f13025192c..ff577b0734 100644 --- a/src/bin/e_pixmap.h +++ b/src/bin/e_pixmap.h @@ -17,6 +17,8 @@ EAPI E_Pixmap *e_pixmap_ref(E_Pixmap *cp); EAPI E_Pixmap *e_pixmap_new(E_Pixmap_Type type, ...); EAPI E_Pixmap_Type e_pixmap_type_get(const E_Pixmap *cp); EAPI void *e_pixmap_resource_get(E_Pixmap *cp); +EAPI E_Comp_Client_Data *e_pixmap_cdata_get(E_Pixmap *cp); +EAPI void e_pixmap_cdata_set(E_Pixmap *cp, E_Comp_Client_Data *cdata); EAPI void e_pixmap_resource_set(E_Pixmap *cp, void *resource); EAPI void e_pixmap_parent_window_set(E_Pixmap *cp, Ecore_Window win); EAPI void e_pixmap_visual_cmap_set(E_Pixmap *cp, void *visual, unsigned int cmap); diff --git a/src/modules/wl_desktop_shell/e_scaler.c b/src/modules/wl_desktop_shell/e_scaler.c index b27798114a..e0aabe9e3b 100644 --- a/src/modules/wl_desktop_shell/e_scaler.c +++ b/src/modules/wl_desktop_shell/e_scaler.c @@ -151,14 +151,11 @@ _e_scaler_cb_get_viewport(struct wl_client *client EINA_UNUSED, struct wl_resour { int version = wl_resource_get_version(scaler); E_Pixmap *ep; - E_Client *ec; struct wl_resource *res; E_Comp_Client_Data *cdata; if (!(ep = wl_resource_get_user_data(surface_resource))) return; - if (!(ec = e_pixmap_client_get(ep))) return; - if (e_object_is_del(E_OBJECT(ec))) return; - if (!(cdata = ec->comp_data)) return; + if (!(cdata = e_pixmap_cdata_get(ep))) return; if (cdata->scaler.viewport) { -- 2.34.1