aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/efl_ui_win.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-11-27 22:50:03 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-11-27 22:50:03 +0900
commit892f4abe3742736dbb02817449da1dd52056ac7f (patch)
tree2d8b586d1ebb1db45a5a1809b9086428bef73060 /src/lib/elementary/efl_ui_win.c
parentecore animator - timer based ticker - add epoll support if available (diff)
downloadefl-892f4abe3742736dbb02817449da1dd52056ac7f.tar.gz
efl ui win - stop trying to get data of non-image icons
x11 updates trying to update x properties from image data when icon is not an image is causing lots of error spam. fix this to check type first before getting data.
Diffstat (limited to 'src/lib/elementary/efl_ui_win.c')
-rw-r--r--src/lib/elementary/efl_ui_win.c57
1 files changed, 30 insertions, 27 deletions
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 499e2d8518..7a61c70050 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -3127,42 +3127,45 @@ _elm_win_xwin_update(Efl_Ui_Win_Data *sd)
{
void *data;
- data = evas_object_image_data_get(sd->icon, EINA_FALSE);
- if (data)
+ if (efl_isa(sd->icon, EFL_CANVAS_IMAGE_CLASS))
{
- Ecore_X_Icon ic;
- int w = 0, h = 0, stride, x, y;
- unsigned char *p;
- unsigned int *p2;
-
- evas_object_image_size_get(sd->icon, &w, &h);
- stride = evas_object_image_stride_get(sd->icon);
- if ((w > 0) && (h > 0) &&
- (stride >= (int)(w * sizeof(unsigned int))))
+ data = evas_object_image_data_get(sd->icon, EINA_FALSE);
+ if (data)
{
- ic.width = w;
- ic.height = h;
- ic.data = malloc(w * h * sizeof(unsigned int));
-
- if (ic.data)
+ Ecore_X_Icon ic;
+ int w = 0, h = 0, stride, x, y;
+ unsigned char *p;
+ unsigned int *p2;
+
+ evas_object_image_size_get(sd->icon, &w, &h);
+ stride = evas_object_image_stride_get(sd->icon);
+ if ((w > 0) && (h > 0) &&
+ (stride >= (int)(w * sizeof(unsigned int))))
{
- p = (unsigned char *)data;
- p2 = (unsigned int *)ic.data;
- for (y = 0; y < h; y++)
+ ic.width = w;
+ ic.height = h;
+ ic.data = malloc(w * h * sizeof(unsigned int));
+
+ if (ic.data)
{
- for (x = 0; x < w; x++)
+ p = (unsigned char *)data;
+ p2 = (unsigned int *)ic.data;
+ for (y = 0; y < h; y++)
{
- *p2 = *((unsigned int *)p);
- p += sizeof(unsigned int);
- p2++;
+ for (x = 0; x < w; x++)
+ {
+ *p2 = *((unsigned int *)p);
+ p += sizeof(unsigned int);
+ p2++;
+ }
+ p += (stride - (w * sizeof(unsigned int)));
}
- p += (stride - (w * sizeof(unsigned int)));
+ ecore_x_netwm_icons_set(sd->x.xwin, &ic, 1);
+ free(ic.data);
}
- ecore_x_netwm_icons_set(sd->x.xwin, &ic, 1);
- free(ic.data);
}
+ evas_object_image_data_set(sd->icon, data);
}
- evas_object_image_data_set(sd->icon, data);
}
}