add checks for pixmap type being X before accessing the image (for

cases where we are running wayland clients)

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2014-05-25 00:45:35 +01:00 committed by Chris Michael
parent 702e3f9763
commit 84f5c2f608
1 changed files with 3 additions and 1 deletions

View File

@ -629,6 +629,7 @@ e_pixmap_image_refresh(E_Pixmap *cp)
{
case E_PIXMAP_TYPE_X:
#ifndef HAVE_WAYLAND_ONLY
if (cp->image) return EINA_TRUE;
if ((!cp->visual) || (!cp->client->depth)) return EINA_FALSE;
cp->image = ecore_x_image_new(cp->w, cp->h, cp->visual, cp->client->depth);
if (cp->image)
@ -654,7 +655,8 @@ e_pixmap_image_exists(const E_Pixmap *cp)
EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE);
#ifndef HAVE_WAYLAND_ONLY
return !!cp->image;
if (cp->type == E_PIXMAP_TYPE_X)
return !!cp->image;
#endif
#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
return (cp->resource != NULL);